Seite 1 von 2
Focus per Befehl auf Gadget setzen ??
Verfasst: 09.02.2005 15:01
von nco2k
hi folks,
wie setze ich den focus auf ein gadget per befehl ??
irgendwie konnte ich dazu nichts finden ?!?!
hoffentlich könnt ihr mir weiter helfen, vielen dank im vorraus!
c ya,
nco2k
Verfasst: 09.02.2005 15:23
von nicolaus
aus der API (PSDK)
The SetFocus function sets the keyboard focus to the specified window. The window must be attached to the calling thread's message queue.
Syntax
HWND SetFocus( HWND hWnd
);
Parameters
hWnd
[in] Handle to the window that will receive the keyboard input. If this parameter is NULL, keystrokes are ignored.
Return Value
If the function succeeds, the return value is the handle to the window that previously had the keyboard focus. If the hWnd parameter is invalid or the window is not attached to the calling thread's message queue, the return value is NULL. To get extended error information, call GetLastError.
hoffe das hilft dir
Verfasst: 09.02.2005 15:26
von nco2k
den befehl kenne ich, hat aber nichts mit gadgets zu tun, sondern ist nur für fenster gedacht. also kann ich das nicht gebrauchen.
c ya,
nco2k
Verfasst: 09.02.2005 15:28
von remi_meier
Gadgets sind Fenster. GadgetID() gibt das Handle zurück.
Verfasst: 09.02.2005 15:30
von nco2k
na wenn das so ist...
c ya,
nco2k
Verfasst: 09.02.2005 15:32
von nicolaus
oder du machst einfach bei deiner erstellung des gadgets z.b. so
Code: Alles auswählen
hbtn = Buttongadget(0,0,0,100,20,"test")
SetFocus_(hbtn)
hbtn is nun dein handle des buttons
Verfasst: 09.02.2005 16:04
von Donald
nco2k hat geschrieben:den befehl kenne ich, hat aber nichts mit gadgets zu tun, sondern ist nur für fenster gedacht. also kann ich das nicht gebrauchen.
c ya,
nco2k
hmmm, ist ja komisch wenn der Befehl nichts mit Gadget´s zu hat frage
ich mich warum es dann funktioniert.
Verfasst: 09.02.2005 16:27
von freedimension
ActivateGadget()
Verfasst: 09.02.2005 16:57
von nco2k
@Donald
tja vieles funktioniert nach dem prinzip
@freedimension
stimmt das gibts ja auch noch.
manchmal sieht man den wald vor lauter bäume nicht mehr.
c ya,
nco2k
Verfasst: 09.02.2005 17:35
von ts-soft
In Windows sind alle Steuerelemente (Gadgets) Fenster. Gadgets sind ChildWindows des eigentlichen Programmfenster. SetFocus_ ist also auch mit Gadgets möglich. Jeder Button oder was sonst noch ist ein Fenster