Solved

In gmail windows , when click on 'compose' button. a New message opens. my queston is what is called that windows. either modal window, or child windows or other etc

Posted on 2014-12-26
5
225 Views
Last Modified: 2014-12-26
I am writing a program in python for finding the windows handle but through this code I am unable to find handle for dialog box (which opens in same windows like gmail compose window)


import win32gui
import win32con
import time
import subprocess
hwnd = 528728
buffer = ''
def all_ok(hwnd,param):
    print hwnd
    return True
def find_windows(starttext):
    win32gui.EnumChildWindows(hwnd,all_ok,None)
def find_forground_win():
    win = win32gui.GetForegroundWindow()
    hwnd = win
    print hwnd
    global hwnd
def find_parent_windows(title):
    print hwnd
    win = win32gui.GetWindowText(hwnd)
    #control_id = win32gui.GetDlgCtrlID(hwnd)
    #print control_id
    #dialog_id = win32gui.GetDlgItemText(hwnd,win32con.WM_GETTEXT)
    #dialog_id = win32gui.GetDlgItem(hwnd,0)
    #print dialog_id
    print win
def main():
    find_forground_win()
    find_windows('')
    find_parent_windows('')
while True:
    main()
    time.sleep(5)
0
Comment
Question by:s_raj93
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:mrwad99
ID: 40518514
Gmail within a browser doesn't use standard Windows controls, so the compose window you see doesn't have a 'handle' as such.  Instead, the *illusion of a window* is given by clever use of Javascript or similar scripting language.

Similarly, all the push buttons, radio buttons and text boxes you see on web pages are not controls, they are actually bitmaps designed to look the same as Windows controls.
0
 

Author Comment

by:s_raj93
ID: 40518602
i had asked what is called called opened window in gmail compose. u guys will not give proper answer, I think answer is given by Robot.
0
 
LVL 19

Accepted Solution

by:
mrwad99 earned 500 total points
ID: 40518922
No, the answer was not given by a robot.  It was given by myself, a software engineer who has tried to do pretty much the same thing as you (except using C++) - getting handles to controls on web pages.

I say again: the compose window is not a "window", it is the illusion of a window provided by Javascript or other scripting.  You cannot get a window handle to it (the type you are looking for is a Win32 opaque data structure called a HWND) because *it is not a window* !
0
 

Author Comment

by:s_raj93
ID: 40519274
Thanks , i got your point.
0
 

Author Closing Comment

by:s_raj93
ID: 40519275
Thanks so much. i understood.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now