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
221 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks , i got your point.
0
 

Author Closing Comment

by:s_raj93
Comment Utility
Thanks so much. i understood.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 6 48
MaxSpan challenge 9 65
Which Microsoft MSDN Package Is The One I need? 3 36
Explain Unit of Work pattern 2 46
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…

763 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

8 Experts available now in Live!

Get 1:1 Help Now