Message board for the users of flat assembler.
> Windows > Miscellaneous questions
ManOfSteel 22 Aug 2006, 09:30
I have some questions about different topics.
1. Cannot 'WS_TABSTOP' be used outside dialog boxes? When I use it like this...
it works, but when I use it like this...
it does not.
Am I missing something here? Do I need to add something to make it work when invoking 'CreateWindowEx', should I invoke some other function I am not aware of, ...?
2. Can I call my own procedures using the 'invoke' pseudo-instruction or will I have to modify the equates, parameters counts, etc...?
3. Are there any macros, procedures or APIs for string manipulation (copy, get length, concatenate, delete character, etc...)?
4. I did not fully understand the use of the pseudo-instruction 'uses' in procedures.
From the manual:
Then also the uses keyword may follow, and after it the list of registers (separated only with spaces) that will be automatically stored on entry to procedure and restored on exit.
Does that mean that the registers I write there will be pushed when entering the procedure and poped when getting out of it, 'uses eax edi esi' being the same as 'push eax edi esi / pop esi edi eax'?
5. I have a problem with the 'WM_SYSCOMMAND' message. Every time I include a
cmp [wmsg],WM_SYSCOMMAND je wmsyscommand
in the WindowProc procedure (along with WM_COMMAND, WM_CREATE, WM_DESTROY, etc...) I am unable to close the program by clicking the 'x' button and I have to terminate it with 'CTRL+ALT+DEL'.
Thank you in advance for your help.
|22 Aug 2006, 09:30||
vid 22 Aug 2006, 10:03
2. you can call your own with "stdcall", not invoke. search board for recent posts with "stdcall" and "invoke", it was explained lately
3. you can use libc(.dll)
(soon there will be FASMLIB prepared for use, unfortunately it isn't in state to become used by now)
4. it means that you can use these registers in functions, but their value will be preserved in prologue / epilogue code. for example:
proc a uses ebx ... ret endp
is same (not really) as
proc a push ebx ... pop ebx ret endp
|22 Aug 2006, 10:03||
afw2004 22 Aug 2006, 11:00
1. You can write your message loop as following
local .msg:MSG lea esi,[.msg] .startloop: invoke GetMessage, esi,0,0,0 test eax,eax jz .endloop invoke IsDialogMessage, [hwndDialog],esi; <-- WS_TABSTOP should process test eax,eax jnz .startloop invoke TranslateMessage, esi invoke DispatchMessage, esi jmp .startloop .endloop:
|22 Aug 2006, 11:00||
ManOfSteel 29 Aug 2006, 07:44
Thank you for your replies.
you can use libc(.dll)
What is that libc? I have no such library in my system. Or could it be called something other than 'libc.dll'.
is same (not really) as
What do you mean by 'not really'? Does it push/pop the registers or not?
Is 'IsDialogMessage' not for dialog boxes only? I need to make it work in the main window.
I have new questions related to files. I recently saw an example on how to use file mapping without ReadFile/WriteFile: by using MapViewOfFile and wsprintf (to write). Is there any other API I could use for writing? What API could I use for reading?
|29 Aug 2006, 07:44||
farrier 29 Aug 2006, 08:10
afw2004 is correct! Attached is a small program which creates a regular widow, then adds a few child controls. You can see how the tab key takes the focus from one control to the other.
invoke TranslateAccelerator, [gWnd], [hAccel], msg
in the message loop, in case there is a keyboard accelerator in the program--not used in this one.
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
|29 Aug 2006, 08:10||
ManOfSteel 02 Sep 2006, 09:05
Thank you everyone, it works fine now.
|02 Sep 2006, 09:05||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.