Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 31st, 2005, 10:34 AM   #11
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 298
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
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.
bigguy is offline   Reply With Quote
Old Oct 31st, 2005, 11:20 AM   #12
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 298
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
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.
bigguy is offline   Reply With Quote
Old Oct 31st, 2005, 11:34 AM   #13
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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.
Rory is offline   Reply With Quote
Old Oct 31st, 2005, 11:42 AM   #14
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 298
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
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.
bigguy is offline   Reply With Quote
Old Oct 31st, 2005, 1:06 PM   #15
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Quote:
Originally Posted by bigguy
OK ty, Rory, but i dont know VB.net, and What about the Child and Parent Windows?
Try EnumChildren, but FindWindowEx should work...
Rory is offline   Reply With Quote
Old Oct 31st, 2005, 1:13 PM   #16
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 298
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
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.
bigguy is offline   Reply With Quote
Old Oct 31st, 2005, 2:07 PM   #17
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 298
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
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.
bigguy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:31 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC