![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Professional Programmer
|
Hey Ya'll got another question. I'm gonna use the API stuff for this also, and this is what I have so far. IE would be the parent window, right. then the Downlaod Window asking whther I save or Open it would be the Child Window, correct. Well Thats what I dont know how to do. I have this
This is in the Module: Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Public Function Find_DownloadWindow() As Long Find_DownloadWindow = FindWindow("#32700(Dialog)", vbNullString) End Function and this is in Form_Load: Private Sub Form_Load() Dim lIEFrame As Long If lIEFrame = FindWindow("#32770(Dialog)", vbNullString) Then Form2.Show End If End Sub Now hwnd is used for Parent Window right, so if that is used for parent windows what used to find out if their is a child window present in the Parent Window?
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain Destruction leads to a very rough road, but it also breeds creation. |
|
|
|
|
|
#12 |
|
Professional Programmer
|
Wait, I chaged some stuff.Here is the new wAY I'm doignit
This is everything, I took out the Module Option Explicit Private Declare Function FINDWINDOW Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private 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 Private Sub Form_Load() Dim lIEFramehwnd As Long lIEFramehwnd = FINDWINDOW("IEFrame", vbNullString) If lIEFramehwnd Then Form2.Show End If End Sub Right now, I have to open IE and than start the program, but If im runnig the program, and than open IE Form2 wont show, any ideas. Also, Im still having problems declaring IEFrame As parnt window, and thna the Downlaod Dialog box as child.
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain Destruction leads to a very rough road, but it also breeds creation. |
|
|
|
|
|
#13 |
|
Expert Programmer
|
Well because you're only checking for the window handle on application startup: a timer or something would work. However the better and more elegant solution would be to register a system hook on the WM_SHOW window message using SetWindowsHookEx and WH_SYSMSGFILTER with a pointer to a SysMsgProc function, which would then let you intercept global window messages at the instant the form is created, and expose a lot more information, just as you would in any other low level language to implement a Win32 Window. Remember lParam not wParam is the one that dereferences to a message structure in this instance.
This would be possible in VB6, however I'd recommend using VB.NET as it has much better support for marshalling structures, and the IDE doesn't use thunks and thus doesn't crash every time you make one silly little API error. |
|
|
|
|
|
#14 |
|
Professional Programmer
|
OK ty, Rory, but i dont know VB.net, and What about the Child and Parent Windows?
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain Destruction leads to a very rough road, but it also breeds creation. |
|
|
|
|
|
#15 | |
|
Expert Programmer
|
Quote:
|
|
|
|
|
|
|
#16 |
|
Professional Programmer
|
So?
Private Sub Form_Load() Dim lIEFramehwnd As Long Dim #32770(Dialog) As Long lIEFramehwnd = FINDWINDOW("IEFrame", vbNullString) #32770(Dialog) = FindWindowEX("#32770(Dialog)", vbNullString Form2.Show End If End Sub #32770(Dialog) = Class for Windows Download Dialog box in IE.
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain Destruction leads to a very rough road, but it also breeds creation. |
|
|
|
|
|
#17 |
|
Professional Programmer
|
Also, the Download Blocker, has to have a password, to allow the donwlaods, and I have fomr where you make the password, but I dont know how to allow, it to just show up once, the user types heir passsord, clikcs Ok its saves password, in memoey, and thna never shows again. I got everything but how to make it not show again after the ye click OK.
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain Destruction leads to a very rough road, but it also breeds creation. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|