hello peoples :bg
can your help me ?
I would like clicking a tab fom my program to a another program
invoke FindWindowEx,ebx,NULL,CTEXT ("SysTabControl32"),0
mov hSysTabControl32,eax
invoke SendMessage,hSysTabControl32,TCM_SETCURSEL,1,TRUE
greets ragdog
What are you trying to do? Which program are you trying to control?
hi
as example this prog!
ragdog
[attachment deleted by admin]
ragdog,
It is hard to know what you are trying to do. Do you want to be able to run a program by clicking a button or something similar.
Paul
i want click a tap button from my prog to a another prog
think you're missing an all important SetFocus call :)
Quote from: ragdog on December 04, 2006, 07:55:59 PM
i want click a tap button from my prog to a another prog
But you are not telling us what the problem is, all you have done is paste three lines of code in your first post. Try posting more code.
.data
szwindow db 'TabControl',0
szSysTabControl32 db 'SysTabControl32',0
.data?
hSysTabControl32 dd ?
.code
start:
invoke FindWindow,0,offset szwindow
invoke FindWindowEx,eax,0,offset szSysTabControl32,0
mov hSysTabControl32,eax
invoke SendMessage,hSysTabControl32,TCM_SETCURSEL,1,TRUE
invoke ExitProcess,0
end start
Quote from: ragdog on December 04, 2006, 09:56:07 PM
.data
szwindow db 'TabControl',0
szSysTabControl32 db 'SysTabControl32',0
.data?
hSysTabControl32 dd ?
.code
start:
invoke FindWindow,0,offset szwindow
invoke FindWindowEx,eax,0,offset szSysTabControl32,0
mov hSysTabControl32,eax
iinvoke SetFocus, eax
push eax
iinvoke SendMessage,hSysTabControl32,TCM_SETCURSEL,1,TRUE
pop eax
invoke SetFocus,eax
invoke ExitProcess,0
end start
also are you checking your code is actually finding the right window?
ragdog,
As evlncrn8 says, you need to process the result of the search. After you call FindWindow add...
cmp eax, 0
je failed
and write an error handler (messagebox, etc.). Also, you are searching by title only. Since many applications will vary what is displayed there, it is problematic. How about ...
invoke FindWindow, offset szSysTabControl32, offset szwindow
or
invoke FindWindow, offset szSysTabControl32, 0
Paul
invoke mouse_event, ......
:toothy