Sorry guyz, but could some1 take 1 sec n look at my code, 2 tell me wut's wrong with it? Why my tabs doesn't appear correctly.. :stupid:
Set the top of your tab's child windows to 30 in the RadASM dialog editor. You can edit the top directly using the entry in the Properties box.
The error is this:
was:
Should be:
It was a window handle problem and not a size one.
RobotBob
was:
;============================================
invoke CreateDialogParam,hInstance,IDD_SEGMENTS,hTab,addr SegmentsProc,0
mov hTabDlg,eax
invoke CreateDialogParam,hInstance,IDD_OPERAND,hTab,addr OperandProc,0
mov hTabDlg[4],eax
;=============================================
Should be:
;=============================================
invoke CreateDialogParam,hWin,IDD_SEGMENTS,hTab,addr SegmentsProc,0
mov hTabDlg,eax
invoke CreateDialogParam,hWin,IDD_OPERAND,hTab,addr OperandProc,0
mov hTabDlg[4],eax
;===============================================
It was a window handle problem and not a size one.
RobotBob
Here it is with repairs and a working exe.
:grin:
Actually i found the solution (like donkey said) and it worked thanks :) but the amazing is that RobotBob's solution made it work too :grin: Dunno why, but thanks alot guyz, i'm back to work.
PS: I started to LUV this place =)
CuTedEvil
Actually i found the solution (like donkey said) and it worked thanks :) but the amazing is that RobotBob's solution made it work too :grin: Dunno why, but thanks alot guyz, i'm back to work.
PS: I started to LUV this place =)
CuTedEvil
RobotBob,
The CreateDialogParam was correct, the first parameter must be hInstance, no idea why it works in your code without it but it may lead to undesired features later if he does not follow the specifications for the API call:
The CreateDialogParam was correct, the first parameter must be hInstance, no idea why it works in your code without it but it may lead to undesired features later if he does not follow the specifications for the API call:
HWND CreateDialogParam( HINSTANCE hInstance,
LPCTSTR lpTemplateName,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam
);
Mmmmm did the ESP fail us ???LPCTSTR lpTemplateName,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam
);
I have never use hInstance inside a WinProc.
Always the hwnd parameter passed to winproc.
There are alot of apis that fail unless this is done.
Always the hwnd parameter passed to winproc.
There are alot of apis that fail unless this is done.
The hInstance is so that the api can find the resource, outside of that there is never a need for it. It simply identifies the module that the resource needs to be loaded from. I have never seen an api that called for the instance handle fail because it was given. I'd be interested to know which ones so I can avoid problems.
I'm interested in ur explanation too :confused:
An instance handle is the starting address of the EXE or DLL in memory where a Window handle is simple a numeric identifier for a Window and they are not the same thing. In an EXE file you can use 400000h which is almost exclusively the start address of an EXE but it does not work in a DLL which can be relocated by the OS to another address if its preferred address is already taken.
Simplest way is to make the instance handle GLOBAL by putting it in the .DATA? section and it then has scope across the whole application. The main purpose of the window handle passed to a WndProc procedure is for the WM_CREATE message where the handle from CreateWindowEx is not yet available but you can use it as well withing the WndProc for any other task.
What happens at times when you fail to specify a window handle is that zero is passed and that is the background handle so it works but for Window specific code, you should pass the correct window handle so that a child window for example has the correct parent window and not the background.
Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Simplest way is to make the instance handle GLOBAL by putting it in the .DATA? section and it then has scope across the whole application. The main purpose of the window handle passed to a WndProc procedure is for the WM_CREATE message where the handle from CreateWindowEx is not yet available but you can use it as well withing the WndProc for any other task.
What happens at times when you fail to specify a window handle is that zero is passed and that is the background handle so it works but for Window specific code, you should pass the correct window handle so that a child window for example has the correct parent window and not the background.
Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
:grin:
Thanks hutch :alright:
Thanks hutch :alright: