Jump to content

B4l4

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by B4l4

  1. Hi, I've read all the postings about parsing JSONs but I can't for the life of me get it to work. I'm trying to extract the "name" and the "value". This is what I've done. #include "Json.au3" $response='{"raw":{},"class":[{"name":"infer","value":"88.1"}],"ref":"ver1","ex":null,"pr":null,"n":null,"re":null,"res":null}' $oJSON = Json_Decode($response) Local $str = json_Get($oJSON, '["class"]["name"]') ConsoleWrite($str) Please help! Thanks.
  2. Hi, I have a monitor running at 1920x1080 (1080p) and another running at 3840x2160 (4K). I'm having real trouble obtaining the screen sizes and placing a multiwindow GUI. I've tried a number of scripts available in the forums, but they all are reporting the same results. Here's the script that I'm currently using which I've gotten from the Internet ;author: ahha ;filename: determine screen sizes v1b.au3 ;http://msdn.microsoft.com/en-us/library/ms724385%28VS.85%29.aspx $VirtX = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 78) ;SM_CXVIRTUALSCREEN 78 ;The width of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors. ;The SM_XVIRTUALSCREEN metric is the coordinates for the left side of the virtual screen. $VirtY = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 79) ;SM_CYVIRTUALSCREEN 79 ;The height of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors. ;The SM_YVIRTUALSCREEN metric is the coordinates for the top of the virtual screen. $Mons = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 80) ;SM_CMONITORS 80 ;The number of display monitors on a desktop. For more information, see the Remarks section in this topic. ;Remarks ;System metrics can vary from display to display. ;GetSystemMetrics(SM_CMONITORS) counts only visible display monitors. This is different from EnumDisplayMonitors, which enumerates both visible display monitors and invisible pseudo-monitors that are associated with mirroring drivers. An invisible pseudo-monitor is associated with a pseudo-device used to mirror application drawing for remoting or other purposes. $LSVS = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 76) ;SM_XVIRTUALSCREEN 76 ;The coordinates for the left side of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. ;The SM_CXVIRTUALSCREEN metric is the width of the virtual screen. $TSVS = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 77) ;SM_YVIRTUALSCREEN77 ;The coordinates for the top of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. ;The SM_CYVIRTUALSCREEN metric is the height of the virtual screen. $PriDispX = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 0) ;SM_CXSCREEN 0 ;The width of the screen of the primary display monitor, in pixels. ;This is the same value obtained by calling GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, HORZRES). $PriDispY = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 1) ;SM_CYSCREEN 1 ;The height of the screen of the primary display monitor, in pixels. ;This is the same value obtained by calling GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, VERTRES). $mz = "SM_CXSCREEN = "&$PriDispX[0] &" SM_CYSCREEN = "&$PriDispY[0] $m0 = "@DesktopWidth = "&@DesktopWidth &" @DesktopHeight = "&@DesktopHeight $m1 = "Number of visible screen monitors: " & $Mons[0] $m2 = "Maximum size of 'virtual screen' : " & $VirtX[0] &"x"& $VirtY[0] $m3 = "Full 'virtual screen' coordinates: " & $LSVS[0] &"," & $TSVS[0] &" to "& $VirtX[0] &","& $VirtY[0] MsgBox(0+262144, "Status of determine screen sizes", $mz &@CRLF& $m0 &@CRLF& $m1 &@CRLF& $m2 &@CRLF& $m3) This reports a virtual screen of 3456x1719 (what???). What does the virtual screen mean, and why isn't it a combination of both screen. Also it reports DesktopWidth as 1920 and DesktopHeight as 1080, i.e. the smaller of two displays. I'm trying to create two GUIs that is maximised on each screen, but these numbers are wrong. Please help. Thanks.
  3. Oops, yes, my mistake then? Need to read the manual more closely. Can you tell me why the app flickers though? Any way to remove it? Thanks again!
  4. Hi Francesco, here's the code, based on an example online: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPISysWin.au3> BackgroundImage() Func BackgroundImage() GUICreate("My background image", 1000, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; will create a dialog box that when displayed is centered Sleep(1000) $hWnd = WinGetHandle("[ACTIVE]") WinActivate($hWnd) GUISetBkColor(0xE0FFFF) Local $idPic = GUICtrlCreatePic("C:\Users\b4l4\Documents\misc\test.jpg", -1, -1, 1000, 1000) GUISetState(@SW_SHOW) _WinAPI_SetWindowPos($hWnd, $HWND_TOP, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE)) ; Loop until the user exits. While 1 _WinAPI_SetWindowPos($hWnd, $HWND_TOP, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE)) ;WinActivate("Program Manager") Sleep(100) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Example Thanks.
  5. Hi, I'm trying to create a program that sits on the desktop, i.e. I want the program to be always be at the bottom. I've tried using _WinAPI_SetWindowPos with $HWND_BOTTOM, but it doesn't work. Can anyone help? Thanks.
×
×
  • Create New...