Sign in to follow this  
Followers 0
CartoonDragon

[Solved] Win 8 and Shell_CharmWindow

5 posts in this topic

#1 ·  Posted (edited)

Hi Everyone,

I hope someone is able to help me here, i want to detect the "Charm" windows in win8 in a hope to control them, but for now i can't even detect them as a window, does anyone know how i'd be able to detect the windows? specficly the window i want to detect is in win8 when you press "Winkey + I"

My initial idea was simple, but doesn't work (tho it might get the wrong Charm window still nothing)

WinWait("[Class:Shell_CharmWindow]")

msgbox(0,"yey", "yey")

So i went and tried with the name of the window, which in my case is "Indstillinger" Tho in english i'm guessing it's "Settings"

WinWait("Settings")

msgbox(0,"yey","yey")

This of course did not work either.

Ultimately what i want to do is to setup a Windows 8 none domain computer to a WPA2 Enterprise network with user credentials with out the user having to set this up manually. This we have done easily in windows XP, Vista and Win7 by using a "Wlan.exe" (Much like netsh, but for winxp as well) to import a wireless profile, this makes all the other windows pop up and promt for the user credentials, but windows 8 does not do this.

Update

-------------------------------

I've found a way to open the network window by sending a command, but still no way of detecting it.

rundll32.exe %SystemRoot%\system32\van.dll, RunVAN

Edited by CartoonDragon

Share this post


Link to post
Share on other sites



I took a look at this. There seems to be an additional layer of security built into Windows 8. You can see a similar behaviour with ProcessExplorer, whereas it can't see anything not spawned by the parent Explorer.exe process. Because the VAN screen can't be stickied, it is impossible to use Au3Info on it properly... which is a pain.

Anyways, I've never been a fan of using graphical automation of applications. You should look into other methods to connect to the wireless network, such as via the command prompt or PowerShell.

Using a .NET Class library:

http://managedwifi.codeplex.com/

Windows Native Wifi API:

http://msdn.microsoft.com/en-us/library/ms705969.aspx

Netsh in Windows 8:

http://thephuck.com/uncategorized/unable-to-edit-delete-wireless-profiles-or-networks-in-windows-8-use-netsh-wlan-to-fix/

http://techmell.com/windows-tips/create-connect-wifi-hotspot-windows-8/

Share this post


Link to post
Share on other sites

Thanks Tripredacus,

I've searched around and found that MattyD has made a very nice Windows Native Wifi API control in Autoit that worked beautifully

Share this post


Link to post
Share on other sites

Because the VAN screen can't be stickied, it is impossible to use Au3Info on it properly... which is a pain.

I haven't looked at the VAN (?) screen, but you know you could unfreeze Au3Info, right? :huh:

Share this post


Link to post
Share on other sites

I haven't looked at the VAN (?) screen, but you know you could unfreeze Au3Info, right? :huh:

Yes, I can get the info from the the VAN (Network Connections) screen already, it is just different. Try it yourself and see what I mean... or maybe I'm not doing it right (this is totally a possibility) :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Yogi Yang
      By Yogi Yang
      Hello,

      I have a need to develop a software that will ultimately run on Windows 8 so I would like to know if anyone has tried to use AutoIT in Win8?

      Will sending of key strokes work properly in Win8?

      I don't have Win8 but the client is upgrading from Win7 to Win8 so this question?

      TIA

      Yogi Yang
    • AdmiralAlkex
      By AdmiralAlkex
      The original resolution switcher by HTC works good on earlier Windows, but has two problems on Win8.
      When activated it creates a window telling the current resolution. It is given focus and thus forces Metro back to the desktop. It switches between the native 800x480 and 1024x600 which is to low to run Metro apps. To fix this I started with a simple script that switches to 1152x864 with a window that displays the resolution without grabbing focus.Later I added some extras:
      Option to skip the window altogether Separate resolution in desktop and Metro A simple installer/uninstaller for the HTC Shift (or other devices that use a synaptics touchpad in the same matter, check the code). Code moved to attachment. See next post for screenshots.


      ResSwitch source.rar
      The .au3 itself Modified (removed duplicate const's) Modified (removed duplicate const's and commented WinXP (+ earlier) code to reduce file size) ResSwitch.rar (previous downloads: 51) A compiled .exe (if you don't have AutoIt? lol) .bat file calling the installer/uninstaller function (optional) .ini file containing the standard settings (optional)
    • AdmiralAlkex
      By AdmiralAlkex
      I wanted to see if I could manage to use IAppVisibility (Win8) in one of my scripts.
      (it seems the name was changed in Release Preview but MSDN wasn't updated)

      It took some time but I learned to make tlb file and made definitions for GetAppVisibilityOnMonitor and IsLauncherVisible methods (working good as far as I can tell), but I would like Advise and Unadvise too if possible, but I don't know how...

      See definition on above link.

      Only example I found is some (too advanced for me to translate) c++ code. Here. But it compiles and runs fine at least.

      trancexx is doing a similar thing in maybe that can be used somehow?

      Anyone have a clue?

      Test script with the working funcs:

      #include <WinAPI.au3> ;=============================================================================== #interface "IAppVisibility" Global Const $sCLSID_AppVisibility = "{7E5FE3D9-985F-4908-91F9-EE19F9FD1514}" Global Const $sIID_IAppVisibility = "{2246EA2D-CAEA-4444-A3C4-6DE827E44313}" ; Definition Global Const $tagIAppVisibility = "GetAppVisibilityOnMonitor hresult(ptr;int*);" & _ "IsLauncherVisible hresult(int*);" & _ "Advise hresult(ptr;dword*);" & _ "Unadvise hresult(dword);" ;============================================================================== Local $oAppVisibility = ObjCreateInterface($sCLSID_AppVisibility, $sIID_IAppVisibility, $tagIAppVisibility) ;~ MsgBox(0, @ScriptName, IsObj($oAppVisibility)) ;~ ConsoleWrite(IsObj($oAppVisibility) & @CRLF) If Not IsObj($oAppVisibility) Then ConsoleWrite("NOT IsObj" & @LF) MsgBox(0, "", "NOT IsObj") Exit EndIf HotKeySet("ö", "_IsLauncherVisible") HotKeySet("å", "_GetAppVisibilityOnMonitor") $oMyError = ObjEvent("AutoIt.Error", "ErrFunc") ; Install a custom error handler $callback=DllCallbackRegister("_MonitorEnumProc","int","ptr;ptr;ptr;lparam") Global $Monitor DllCall("user32.dll","int","EnumDisplayMonitors","ptr",0,"ptr",0,"ptr",DllCallbackGetPtr($callback),"lparam",10) While 1 Sleep(1000) WEnd Func _IsLauncherVisible() Local $bVisible $iRet = $oAppVisibility.IsLauncherVisible($bVisible) ;~ If @error Then ;Enable this and disable AutoIt.Error if on Alpha ;~ MsgBox(0, @ScriptName, @error) ;~ EndIf ToolTip("1: " & $iRet & @CRLF & "2: " & $bVisible) EndFunc Func _GetAppVisibilityOnMonitor() Local $iMode $iRet = $oAppVisibility.GetAppVisibilityOnMonitor($Monitor, $iMode) ToolTip("1: " & $iRet & @CRLF & "2: " & $iMode) EndFunc ; This is a custom error handler Func ErrFunc() $HexNumber = Hex($oMyError.number, 8) MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "WinDescription is: " & $oMyError.windescription) $iEventError = 1 ; Use to check when a COM Error occurs EndFunc ;==>ErrFunc Func _MonitorEnumProc($hMonitor, $hdcMonitor, $lprect, $lparam) MsgBox(0, "Monitor", "Monitor handle: " & $hMonitor & @CRLF & "LPARAM: " & $lparam) $Monitor = $hMonitor EndFunc
      Here's tlb stuff:

      ================================================================================== coclass AppVisibility; CLSID = {7E5FE3D9-985F-4908-91F9-EE19F9FD1514}; // Implemented interface: <Interface> IAppVisibility ================================================================================== Interface IAppVisibility; IID = {2246EA2D-CAEA-4444-A3C4-6DE827E44313}; // Inherits from: IUnknown {00000000-0000-0000-C000-000000000046} 1. STDCALL FUNC PUREVIRTUAL; HRESULT GetAppVisibilityOnMonitor( [in] hMonitor, [out] int* pMode ); 2. STDCALL FUNC PUREVIRTUAL; HRESULT IsLauncherVisible( [out] int* pfVisible ); 3. STDCALL FUNC PUREVIRTUAL; HRESULT Advise( [in] * pCallback, [out] dword* pdwCookie ); 4. STDCALL FUNC PUREVIRTUAL; HRESULT Unadvise( [in] dword dwCookie ); ================================================================================== enum MONITOR_APP_VISIBILITY; { MAV_UNKNOWN = 0, MAV_NO_APP_VISIBLE = 1, MAV_APP_VISIBLE = 2 }; ================================================================================== Interface IAppVisibilityEvents; IID = {6584CE6B-7D82-49C2-89C9-C6BC02BA8C38}; // Inherits from: IUnknown {00000000-0000-0000-C000-000000000046} 1. STDCALL FUNC PUREVIRTUAL; HRESULT AppVisibilityOnMonitorChanged( [in] hMonitor, [in] previousMode, [in] currentMode ); 2. STDCALL FUNC PUREVIRTUAL; HRESULT LauncherVisibilityChange( [in] int currentVisibleState ); ==================================================================================
    • lawson23
      By lawson23
      Please I would like to create a script that will configure my wireless settings for all my pc's my org.

      I have ways of deployment and also want to put this into my scripted deployment for new machines.

      I have not used autoit in like 4 years and I'm not a programmer I'm a network admin. I have been reviewing MattyD's scripts () he created but my one question and problem is I really don't understand where to begin as he does not have like a walk through.

      1. what is the difference between the a and b files?

      Which file do I edit?

      Is there any newb information on how to walk through getting started using his stuff to do what I need?

      I have a basic wpa tkip configuration I need to setup. Windows XP SP3
      SSID: WSLAN
      Network Authentication: WPA-PSK
      Data Encryption: TKIP
      Network key: 123456789samplePassword12345789
      NO IEEE 802.1x authentication
      yes - connect when this network is in range.

      Please any help in getting started with this would be very grateful.

      Until I can get more help with MattyD's stuff I have modified and used:

      Not perfect but it does exactly what I need it to do.