News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

can your help me

Started by ragdog, December 03, 2006, 03:58:31 PM

Previous topic - Next topic

ragdog

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

sluggy

What are you trying to do? Which program are you trying to control?

ragdog

hi

as example this prog!


ragdog

[attachment deleted by admin]

PBrennick

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
The GeneSys Project is available from:
The Repository or My crappy website

ragdog

i want click a tap button from my prog to a another prog

evlncrn8

think you're missing an all important SetFocus call :)

sluggy

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.

ragdog

.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

evlncrn8

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?

PBrennick

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
The GeneSys Project is available from:
The Repository or My crappy website

Tedd

invoke mouse_event, ......
:toothy
No snowflake in an avalanche feels responsible.