flat assembler
Message board for the users of flat assembler.
Index
> Windows > Simple about box help |
Author |
|
revolution 23 Dec 2011, 10:04
I can't find the code attachment in your post. It would be easier for us to help you if you gave us something to work with, because we don't know what you have done.
|
|||
23 Dec 2011, 10:04 |
|
rohagymeg 23 Dec 2011, 10:20
Code: proc WindowProc, hWnd, uMsg, wParam, lParam local pt:POINT mov eax, [uMsg] mov ebx, [wParam] cmp ebx, IDM_ABOUT jne @f invoke ShowWindow, [hwndabout],SW_SHOW jmp .returning @@: cmp ebx, IDM_EXIT je exit cmp eax, WM_DESTROY jne @f ;invoke ShowWindow, [hwndabout],SW_SHOW When pressing the x, it should just hide itself jmp exit ;if i didn't put this here, I would always have to kill the process @@: cmp eax, WM_SHELLNOTIFY jne .returning cmp [lParam],WM_RBUTTONDOWN jne .returning lea eax,[pt] invoke GetCursorPos, eax invoke SetForegroundWindow,[hwnd] invoke TrackPopupMenu, [hMenu], TPM_LEFTALIGN,[pt.x], [pt.y],0,[hwnd],0 .returning: invoke DefWindowProc,[hWnd],[uMsg],[wParam],[lParam] ret endp I don't want the main invisible msg only window [hwnd]to be closed when I close the other [hwndabout] |
|||
23 Dec 2011, 10:20 |
|
revolution 23 Dec 2011, 10:32
rohagymeg: I can't compile your code. It appears to be incomplete.
|
|||
23 Dec 2011, 10:32 |
|
rohagymeg 23 Dec 2011, 10:34
It was just a snippet, sorry for that. I will send you the whole file in pm.
|
|||
23 Dec 2011, 10:34 |
|
revolution 23 Dec 2011, 10:35
Don't pm me the file please. Post it here so others can help you. I can't do it all.
|
|||
23 Dec 2011, 10:35 |
|
rohagymeg 23 Dec 2011, 10:47
I made it compileable. Please show me how one can make it so when you close the about box/window, the program doesn't close, only the window hides.
|
|||||||||||
23 Dec 2011, 10:47 |
|
JohnFound 23 Dec 2011, 11:04
You must process WM_CLOSE message, not WM_DESTROY.
Example: Code: cmp eax, WM_CLOSE je .closeit ;........ ;.......... .closeit: invoke ShowWindow, [hWnd], SW_HIDE xor eax, eax ret Note that you should not pass WM_CLOSE to DefWindowProc, because it will destroy the window. Also, there are many flaws in your code, including the whole structure and source layout. If this is intended to become usable program, you have to clean the mess and make it more readable. |
|||
23 Dec 2011, 11:04 |
|
rohagymeg 23 Dec 2011, 11:11
Thanks for the help! I know I am a beginner, but I removed a lot of things like comments and unrelated code for the simplicity of the example. I'm reading msdn all day like crazy:) When the main functions are ready, I will clean it up.
|
|||
23 Dec 2011, 11:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.