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
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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…

717 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