Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Add ability to search window titles using classname+regexp


  • Please log in to reply
7 replies to this topic

#1 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,250 posts

Posted 12 August 2007 - 11:01 PM

Hi all,

Sometimes we need to get title from not so standard windows, such as "Save As"..

For example (this is my case), i need to get title from saving dialog of MS Office applications - for MS Word i do that:

Opt("WinTitleMatchMode", 4) $Title = WinGetTitle("classname=#32770", "FolderView") If $Title = 0 Then $Title = WinGetTitle("classname=bosa_sdm_Microsoft Office Word 11.0", "FolderView") ConsoleWrite($Title)ƒo݊÷ Ø­~Šè¶«²Æ²>Œ¬ú"žØ­ßÛ'¢Ü(®HŸ‰Æ§r‰›Šwœ•«,©žú· {bÂ)ev‹(šØbž b‘ëaŠÆ®¶ˆ­sd÷B‚gV÷Cµv–åF—FÆTÖF6„ÖöFRgV÷C²ÂB¢b33cµF—FÆRÒv–ävWEF—FÆR‚gV÷C¶6Æ76æÖR·&VvW‡Ö&÷6÷6F҂⢒gV÷C²ÂgV÷C´föÆFW%f–WrgV÷C²


Because almoust all saving dialogs from MS xx have at the begining of class this: bosa_sdm

But this feature will be usefull not just in my case.

Thanks.
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team








#2 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,544 posts

Posted 13 August 2007 - 05:47 AM

Hi all,

Sometimes we need to get title from not so standard windows, such as "Save As"..

For example (this is my case), i need to get title from saving dialog of MS Office applications - for MS Word i do that:

Opt("WinTitleMatchMode", 4) $Title = WinGetTitle("classname=#32770", "FolderView") If $Title = 0 Then $Title = WinGetTitle("classname=bosa_sdm_Microsoft Office Word 11.0", "FolderView") ConsoleWrite($Title)ƒo݊÷ Ø­~Šè¶«²Æ²>Œ¬ú"žØ­ßÛ'¢Ü(®HŸ‰Æ§r‰›Šwœ•«,©žú· {bÂ)ev‹(šØbž b‘ëaŠÆ®¶ˆ­sd÷B‚gV÷Cµv–åF—FÆTÖF6„ÖöFRgV÷C²ÂB¢b33cµF—FÆRÒv–ävWEF—FÆR‚gV÷C¶6Æ76æÖR·&VvW‡Ö&÷6÷6F҂⢒gV÷C²ÂgV÷C´föÆFW%f–WrgV÷C²


Because almoust all saving dialogs from MS xx have at the begining of class this: bosa_sdm

But this feature will be usefull not just in my case.

Thanks.

just read the doc about advanced windows matching :)

#3 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,250 posts

Posted 13 August 2007 - 08:10 PM

just read the doc about advanced windows matching

Oh, i read it many times, thanks, but still i do not understand how to combine class with regexptitle ?

Here what i am trying:

Opt("WinTitleMatchMode", 4) $Title = WinGetTitle("[CLASS:bosa_sdm; REGEXPTITLE:(?i)(.*)]", "FolderView") ConsoleWrite($Title)


I get 0 :)

I mean, i need to search for window with classname that starts from bosa_sdm, and ends with any string (.*) - I do not think that this is can be done now in AutoIt (using standard functions) - i wish i wrong.
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#4 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,544 posts

Posted 14 August 2007 - 05:44 AM

Oh, i read it many times, thanks, but still i do not understand how to combine class with regexptitle ?

Here what i am trying:

Opt("WinTitleMatchMode", 4) $Title = WinGetTitle("[CLASS:bosa_sdm; REGEXPTITLE:(?i)(.*)]", "FolderView") ConsoleWrite($Title)


I get 0 :)

I mean, i need to search for window with classname that starts from bosa_sdm, and ends with any string (.*) - I do not think that this is can be done now in AutoIt (using standard functions) - i wish i wrong.

perhaps it does not work but that what Jon intent to do perhaps I broke it when I try to simplifly the doubling chars. I have a look if I can reproduce :P
Edit: Wintitlematch is not need with this "Advanced Windows descriptions"

Edited by jpm, 14 August 2007 - 05:46 AM.


#5 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,544 posts

Posted 14 August 2007 - 05:54 AM

First thing class and reggexptitle are indepedant I mean class is match as is and after the regexptitle will apply to those matched windows
That does not solved your issue

#6 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,250 posts

Posted 27 December 2007 - 04:04 PM

Is this will be implemented some day? :) just bumping as Jon said :P
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#7 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 11 January 2008 - 11:50 PM

It sounds to me like the most simple solution is to add a new CLASSREGEX property. Shouldn't be that hard (I haven't looked at the code)?

#8 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,250 posts

Posted 18 January 2008 - 02:22 AM

It sounds to me like the most simple solution is to add a new CLASSREGEX property.

And most effective solution :D - it would be perfect if this property will be added.

Thanks.
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users