Προς το περιεχόμενο

VB FindWindowEX


NickTheGreek

Προτεινόμενες αναρτήσεις

Δημοσ.

Esto oti ftiaxnoume ena programma me thn vb6,pou periexei 3 command buttons.Ta command1.command2,command3.To onomazoume Progr1 kai to metatrepoume se EXE.<P>Ftiaxnoume ena deutero programmataki sto opoio bazoume tis akolouthes entoles:<P>Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long<BR>Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hwnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long<P>dim hwnd1 as long,ret as long<BR>dim comstr as string<P>hwnd1=findwindow(vbnullstring,"Progr1")<P>comstr="command1" (ena apo ta commands tou Progr1)<BR>if hwnd1<>0 then<BR> ret=findwindowex(hwnd1,0,vbnullstring,comstr) <BR> <BR>To programma tha entopisei ena apo ta commands tou Progr1 alla etsi kai prospathisoume na entopisoume ta alla allazontas thn metabliti se comstr=command2 h command3 tha apotixoume.Kano kapou lathos???Ksereis kaneis giati h pos parakamptetai???

Δημοσ.

O kwdikas sou einai swstos -kai bgazei apotelesma kai gia ta tria buttons -prosekse mono to onoma tis formas toy Prog1 na einai "Prog1"-kai prosekse to programma apo to opoio trexeis ti routina na min exei forma me caption "Prog1".

Δημοσ.

Eixes dikio gia to programma den to eixa dokimasei sorry.Htan omos endeiktiko.Auto pou thelo na kano einai na bro prota to hwnd enos RichTextBox enos allou programmatos kai epeita na allakso to text tou os eksis:<BR>Esto oti exoume idi ftiaksei ena programma (prog1) me orismena textboxes px rtext1,rtext2 kai rtext3<BR>Ftiaxnoume ena deutero:<P>Dim hwnd1 As Long, ret As Long<BR>Dim comstr As String, msg As String<P><BR>hwnd1 = FindWindow(vbNullString," Progr1") <P>comstr = "rtext2" '(ena apo ta rtexts tou Progr1)<BR>If hwnd1 <> 0 Then<BR> ret = FindWindowEx(hwnd1, 0, vbNullString, comstr)<BR> if ret<>0 then <BR> msg = "Ola ok"<BR> ret = SendMessage(ret, &HC, 0&, ByVal msg) 'allagh tou text tou parathirou me .hwnd=ret se text=msg<BR>end if<P>End If<P><BR>E to text tou Progr1 den prokeitai pote na allaksei...oute kan to .hwnd tou rtext den tha brei.An exeis lush s'auto kala tha 'tane.<BR>Basika to problima parakamptetai an me to pou tha treksoume to Progr1 apothikeusoume se ena arxeio ta hwnd twn textboxes kai epeita paroume tous arithmous autous kateutheian me to deutero programma xoris na anagkastoume na tous broume monoi mas,alla den m'aresoun tetoies luseis.Ase pou mou gine emmoni idea ti ftaiei.<P>Ypopsin oti douleuei me kanonika textboxes.

Δημοσ.

Eisai poli konta se kati kalo wink.gif" border="0 Mou thimises ena prog pou eixa ftiaksei gia na blepeis keimeno katw apo asteriskous (password -opws sto connect- try it!!)

Δημοσ.

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><HR>Originally posted by NickTheGreek:<BR><STRONG>Xexe.Den psaxno kati tetoio pantos an kai nomizo oti m'ena mono api ginetai h olh douleia me tous asteriskous.</STRONG><HR></BLOCKQUOTE><P>Swsta mantepses-apla gnwrizontas briskontas to handle tou edit control stelneis SendMessage to WM_GETTEXT.

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...