Forum | | | |  Timotheus | Hi,
I have a problem. i want at a designed place in the program Window a EditBox create. The y-Koordinate becomes by the Click select, and the x-k. is 0. in this Edit-Box can but already one Text stand. therefore must I the Click once more repeat, once the Edit created watts. therefore setting itself the Cursor in the Edit very on The right place, How in a MultiEdit. How do I do the ? 
Timo |
| | | | |
| |  Michael Dell | Hello Timo,
if I the right see Dou you mean well ne manner Listbox. then helps you Maybe these demonstration:  CompileMarkSeparationDef LB_LastItem(1) Int(Sub(SendMessage(@&(1),$018B,0,0),1)) Index-Nummer des letzten Eintrag
Def LB_DelSel(1) SendMessage(@&(1),$0186,-1,0) hebt Markierungen auf
Def LB_GetSel(1) SendMessage(@&(1),$0188,0,0) Index-Nummer des Markierten Eintrags
Def LB_SelLastItem(1) SendMessage(@&(1),$0186,LB_LastItem(@&(1)),0) letzten Eintrag markieren
Def LB_SetSel(2) SendMessage(@&(1),$0186,@&(2),0) bestimmten Eintrag markieren
Declare lb01&
Cls
lb01& = Create(ListBox,%HWnd,,40,40,200,360) Erzeuge Listbox
AddString(lb01&,Eintrag_0) Setze Einträge 0-4
AddString(lb01&,Eintrag_1)
AddString(lb01&,Eintrag_2)
AddString(lb01&,Eintrag_3)
AddString(lb01&,Eintrag_4)
Achtung der erste Eintrag hat den Index 0
MessageBox(Str$(LB_LastItem(lb01&)),Letzter Eintrag:,0) Ausgabe Letzter Eintrag
LB_SetSel(lb01&,2) Markiere Eintrag Nr.: 2
MessageBox(Str$(LB_GetSel(lb01&)),Eintrag:,0) Ausgabe Eintrag
LB_DelSel(lb01&) Hebe Markierung auf
MessageBox(Str$(LB_GetSel(lb01&)),Eintrag:,0) Ausgabe Eintrag
LB_SelLastItem(lb01&) Markiere letzten Eintrag
MessageBox(Str$(LB_GetSel(lb01&)),Eintrag:,0) Ausgabe Eintrag
LB_DelSel(lb01&) Hebe Markierung auf
MessageBox(Str$(LB_GetSel(lb01&)),Eintrag:,0) Ausgabe Eintrag
WhileNot Equ(%MenuItem,-2)
WaitInput
If GetFocus(lb01&)
MessageBox(Str$(LB_GetSel(lb01&)),Eintrag:,0) Ausgabe Eintrag
Sleep 10
LB_DelSel(lb01&) Hebe Markierung auf
SetActiveWindow(%HWnd) Setze Focus aufs Hauptfenster
EndIf
EndWhile
End
Greeting
Michael |
| | | Salu Michael...
Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! | 09/11/04 ▲ |
| |
| |  Timotheus | i want at a defined place one Edit produce.
the happens if a MausTaste pressed becomes: Create(Edit,%Hwnd,i'm one Edit,0,%mousey,%WinRight,25)
now would like I but whom Schreibbalken in the Edit on The right place bring. that is if I integrally left on the Window a Mausteste press, then would like I first the Edit produce, and then on %Mousex and %Mousey a Click simulate. therefore is then the Schreibbalken to the first characters.
Timo |
| | | | |
| |  Michael Dell | Sorry, small mistake! 
Versuchs time herewith, it setting whom Cursor on whom beginning: CompileMarkSeparationDef SetCurPosNull(1) sendmessage(@&(1),$00B1,0,0) Setzt den Cursor an den Anfang
declare ed01&
cls
ed01& = createedit(%HWnd,Hallolo, na wie gethts?,10,10,400,20)
WhileNot Equ(%MenuItem,-2)
WaitInput
Case GetFocus(ed01&): SetCurPosNull(ed01&)
EndWhile
Salu Michael...
Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! | 09/11/04 ▲ | |
| |
| |  Timotheus | not integrally, if to that example The mouse something moreover lane of left Fensterrand pressed becomes, then must the Schreibbalken on z.B. the second place stand. concise and simply: How can I a Click at a designed place simulate?
Timo |
| | | | |
| |  Michael Dell | OK, then time so:  CompileMarkSeparationDef GSC(1) !User32.dll,GetSysColor
Def ButtonUp(1) Equ(If(Equ(%Lastmessage,514),1,If(Equ(%Lastmessage,512),SetFocus(&(1)),0)),1)
Def SetCurPosNull(1) SendKey(@&(1),36) Setzt den Cursor an erste Stelle
Def SetCurPosEnd(1) SendKey(@&(1),35) Setzt den Cursor an letzte Stelle
Proc SetCurPos Setzt den Cursor an beliebige Stelle
Parameters hndl&,anz&
Case Lt(anz&,1)
SendKey(hndl&,36)
WhileLoop 1,@&(2),1
SendKey(hndl&,39)
EndWhile
EndProc
declare bt01&,ed01&,edak%
Clear bt01&,ed01&,edak%
Proc MakeED
Parameters HWHndl&,Text$,x%,y%,b%,h%
If Equ(edak%,0) wenn Edit-Control nicht existent dann...
ed01& = create(Edit,HWHndl&,Text$,x%,y%,b%,h%) Erzweuge Edit-Control mit Text inhalt
SetFocus(ed01&) Setze Focus auf Edit-Control
SetCurPos(ed01&,8) Setzt den Cursor an Stelle 8
Sleep 1000
SetCurPos(ed01&,6) Setzt den Cursor an Stelle 6
Sleep 1000
SetCurPos(ed01&,4) Setzt den Cursor an Stelle 4
Sleep 1000
SetCurPos(ed01&,2) Setzt den Cursor an Stelle 2
Sleep 1000
SetCurPosNull(ed01&) Setzt den Cursor an erste Stelle
Sleep 1000
SetCurPosEnd(ed01&) Setzt den Cursor an letzte Stelle
Sleep 1000
SetCurPosNull(ed01&) Setzt den Cursor an erste Stelle
Sleep 1000
EndIf
Return 1
EndProc
SetTrueColor 1
WindowStyle 26
Window Add(%maxX,10),0-500,66
Cls GSC(15)
bt01& = create(Button,%HWnd,Erstelle Edit,360,10,120,22)
Window 0,0-500,66
WhileNot Or(Equ(%MenuItem,-2),Equ(%MenuItem,-4000))
GetMessage
If GetFocus(bt01&)
If ButtonUp(%HWnd)
edak% = MakeED(%HWnd,Hallolo, na wie gethts?,10,10,340,22)
Case edak%: SetFocus(ed01&)
EndIf
EndIf
EndWhi
End
Michael...
P.s.: Have I everything in the Profan- Help nachgeschlagen!  |
| | | Salu Michael...
Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! | 09/12/04 ▲ |
| |
| |  Timotheus | No the neither! 
here time one demonstration: CompileMarkSeparation here missing only The Def or Proc SimuliereMausklick. in this example is the Schreibbalken by the wiederholte clicking on the right place. this is How if one into vorhandenes Edit clicking, then setting itself the beam indeed automatically on The place The in the Edit klicked watts.
Timo |
| | | | |
| |  | so? CompileMarkSeparationcls
declare x%,a&,b&
while 1
waitinput
if %Mousekey = 1
x% = %Mousex
a& = Create(Edit,%Hwnd,Hallo,0,%Mousey - 12,600,25)
@SENDMESSAGE(a&,$00B1,0,256)
@SETFOCUS(A&)
Sleep 1000
destroyWindow(a&)
endif
wend
or so?? CompileMarkSeparationDEF @mouse_event(5)!User32,mouse_event
CLS
declare x%,a&,b&
while 1
Waitinput
if %Mousekey = 1
x% = %Mousex
a& = Create(Edit,%Hwnd,Hello,0,%Mousey - 12,600,25)
@mouse_event(2,x%,%MOUSEY,0,0)
@mouse_event(4,x%,%MOUSEY,0,0)
@mouse_event(2,x%,%MOUSEY,0,0)
@mouse_event(4,x%,%MOUSEY,0,0)
Sleep 1000
destroyWindow(a&)
endif
wend
|
| | | | |
| |  Dietmar Horn | yet as appendix (to response of Andreas)
DEF @mouse_event(5)!User32,mouse_event
mouse_event(n,dx%,dy%,0,0)
=> resolve a artificial Mausbewegung and a Click from. => has none Return Value
n: gives on, which Mouse button pressed (simulate) go should
n = $1 - Double click simulate n = $2 - left Mouse button runterdrücken n = $4 - left Mouse button release n = $8 - rights Mouse button runterdrücken n = $10 - rights Mouse button release n = $20 - mittlere Mouse button runterdrücken (if present) n = $40 - mittlere Mouse button release (if present)
dx% = x-Koordinate the Mausposition (or its Änderung, where tappt im dunkeln from the derzeitigen position from seen, hingesetzt go should) dy% = y-Koordinate the Mausposition (or its ...)
The 4. and 5. Parameter having no weight, therefore means each on 0 settle.
possible must You another slightly with the Mouse-Coordinates experiment, white not, whether these relatively or utterly are, whether related on the Desktop, the Mainwindow, or the Dialog-Window. try thereby too time $8000 with whom Values for n To add, means n = $8000 + $2, or n = $2 settle. $8000 = MOUSEEVENTF_ABSOLUTE
Greeting Dietmar |
| | | Multimedia für Jugendliche und junge Erwachsene - MMJ Hoyerswerda e.V. [...]  Windows 95 bis Windows 7 Profan² 6.6 bis XProfan X2 mit XPSE Das große XProfan-Lehrbuch: [...]  | 09/12/04 ▲ |
| |
| |  Timotheus | thanks 
Timo |
| | | | |
| |  Uwe ''Pascal'' Niemeier | Hello people!
Gibts because The API mouse_event XP/NT at all yet? Quote of MSDN:
The mouse_event function synthesizes mouse motion and button clicks. windows NT: Diese function has been superseded. Use SendInput instead.
SeeYou Pascal |
| | | | |
| |  Michael Dell | Microsoft wished mouse_event already former supplant, the standing anyway so in the WinHlp no Win32s. I denk from Supportgründen functions it in the momentum yet, one ought to well in future hereon dispense. In Longhorn Better get going well not any more weg.
Michael... |
| | | Salu Michael...
Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! | 09/13/04 ▲ |
| |
|
AnswerThemeninformationenthis Topic has 5 subscriber: |