oMBRa Posted October 30, 2008 Share Posted October 30, 2008 _WinAPI_DrawEdge requires BorderConstants.au3 but I dont have it, I have autoit version 3.2.12.1 and Beta Link to comment Share on other sites More sharing options...
Andreik Posted October 30, 2008 Share Posted October 30, 2008 _WinAPI_DrawEdge requires BorderConstants.au3 but I dont have it, I have autoit version 3.2.12.1 and BetaYou need only WinAPI.au3. There is all constants for _WinAPI_DrawEdge. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Malkey Posted October 30, 2008 Share Posted October 30, 2008 (edited) _WinAPI_DrawEdge requires BorderConstants.au3 but I dont have it, I have autoit version 3.2.12.1 and BetaAll the constants are found in this thread http://www.autoitscript.com/forum/index.ph...ost&p=77558 Reproduced here. I suppose this could be called the missing BorderConstants.au3 file. Global Const $BDR_RAISEDOUTER = 0x1 Global Const $BDR_SUNKENOUTER = 0x2 Global Const $BDR_RAISEDINNER = 0x4 Global Const $BDR_SUNKENINNER = 0x8 Global Const $EDGE_BUMP = (BitOR($BDR_RAISEDOUTER,$BDR_SUNKENINNER)) Global Const $EDGE_ETCHED = (BitOR($BDR_SUNKENOUTER,$BDR_RAISEDINNER)) Global Const $EDGE_RAISED = (BitOR($BDR_RAISEDOUTER, $BDR_RAISEDINNER)) Global Const $EDGE_SUNKEN = (BitOR($BDR_SUNKENOUTER,$BDR_SUNKENINNER)) Global Const $BF_ADJUST = 0X2000 Global Const $BF_BOTTOM = 0X8 Global Const $BF_DIAGONAL = 0X10 Global Const $BF_FLAT = 0X4000 Global Const $BF_LEFT = 0X1 Global Const $BF_MIDDLE = 0X800 Global Const $BF_MONO = 0X8000 Global Const $BF_RIGHT = 0X4 Global Const $BF_SOFT = 0X1000 Global Const $BF_TOP = 0X2 Global Const $BF_BOTTOMLEFT = (BitOR($BF_BOTTOM,$BF_LEFT)) Global Const $BF_BOTTOMRIGHT = (BitOR($BF_BOTTOM,$BF_RIGHT)) Global Const $BF_DIAGONAL_ENDBOTTOMLEFT = (BitOR($BF_DIAGONAL,$BF_BOTTOM,$BF_LEFT)) Global Const $BF_DIAGONAL_ENDBOTTOMRIGHT = (BitOR($BF_DIAGONAL,$BF_BOTTOM,$BF_RIGHT)) Global Const $BF_DIAGONAL_ENDTOPLEFT = (BitOR($BF_DIAGONAL,$BF_TOP,$BF_LEFT)) Global Const $BF_DIAGONAL_ENDTOPRIGHT = (BitOR($BF_DIAGONAL,$BF_TOP,$BF_RIGHT)) Global Const $BF_RECT = (BitOR($BF_LEFT,$BF_TOP,$BF_RIGHT,$BF_BOTTOM)) Global Const $BF_TOPLEFT = (BitOR($BF_TOP,$BF_LEFT)) Global Const $BF_TOPRIGHT = (BitOR($BF_TOP,$BF_RIGHT)) Edit: 31/10/2008 I copied zorphnog Post No.10 In to avoid future problems. I had the same problem with the order of declarations. Should have reposted this a lot earlier. Edited October 30, 2008 by Malkey Link to comment Share on other sites More sharing options...
oMBRa Posted October 30, 2008 Author Share Posted October 30, 2008 (edited) I did this #Include <WinAPI.au3> $tRECT = DllStructCreate($tagRECT) DllStructSetData($tRECT, 'Left', 5) DllStructSetData($tRECT, 'Top', 5) DllStructSetData($tRECT, 'Right', 250) DllStructSetData($tRECT, 'Bottom', 50) $hDC = _WinAPI_GetDC(0) _WinAPI_DrawEdge($hDc, $tRECT, 0x4, 0x10) but I get this error: 'An error has occurred with autoit3.exe. The application will be closed.' here is a screenshoot Edited October 30, 2008 by oMBra Link to comment Share on other sites More sharing options...
zorphnog Posted October 30, 2008 Share Posted October 30, 2008 I'm guessing that you don't have a valid DC handle since I don't see how '0' could be a valid window handle. Try adding some error proofing: $hDC = _WinAPI_GetDC(0) If $hDC <> 0 Then _WinAPI_DrawEdge($hDc, $tRECT, 0x4, 0x10) Link to comment Share on other sites More sharing options...
oMBRa Posted October 30, 2008 Author Share Posted October 30, 2008 here is my updated code: #Include <WinAPI.au3> $tRECT = DllStructCreate($tagRECT) DllStructSetData($tRECT, 'Left', 5) DllStructSetData($tRECT, 'Top', 5) DllStructSetData($tRECT, 'Right', 250) DllStructSetData($tRECT, 'Bottom', 50) $hDC = _WinAPI_GetDC(_WinAPI_GetDesktopWindow()) _WinAPI_DrawEdge($hDc, $tRECT, 0x4, 0x10) but I still get that error I said above Link to comment Share on other sites More sharing options...
zorphnog Posted October 30, 2008 Share Posted October 30, 2008 You're still not checking if $hDC is a valid handle! If you call _WinAPI_DrawEdge without a valid handle you're going to get a runtime error, but after further analysis its probably the $tRECT that is crashing it. You need to pass a pointer to $tRECT. #Include <WinAPI.au3> $tRECT = DllStructCreate($tagRECT) $pRECT = DllStructGetPtr($tRECT) DllStructSetData($tRECT, 'Left', 5) DllStructSetData($tRECT, 'Top', 5) DllStructSetData($tRECT, 'Right', 250) DllStructSetData($tRECT, 'Bottom', 50) $hDC = _WinAPI_GetDC(_WinAPI_GetDesktopWindow()) If $hDC <> 0 Then _WinAPI_DrawEdge($hDc, $pRECT, 0x4, 0x10) Link to comment Share on other sites More sharing options...
oMBRa Posted October 30, 2008 Author Share Posted October 30, 2008 (edited) yes it needs a pointer, that's my error, but when I try to load those constants I get this: C:\Programmi\AutoIt3\Include\BorderConstants.au3(24,56) : WARNING: $BF_LEFT: possibly used before declaration. Global Const $BF_BOTTOMLEFT = BitOR($BF_BOTTOM,$BF_LEFT) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Programmi\AutoIt3\Include\BorderConstants.au3(25,58) : WARNING: $BF_RIGHT: possibly used before declaration. Global Const $BF_BOTTOMRIGHT = BitOR($BF_BOTTOM,$BF_RIGHT) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Programmi\AutoIt3\Include\BorderConstants.au3(29,66) : WARNING: $BF_TOP: possibly used before declaration. Global Const $BF_DIAGONAL_ENDTOPLEFT = BitOR($BF_DIAGONAL,$BF_TOP, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\oMBra\Desktop\Nuovo AutoIt v3 Script (8).au3 - 0 error(s), 3 warning(s) ->15:47:11 AU3Check ended.rc:1 >Running:(3.2.12.1):C:\Programmi\AutoIt3\autoit3.exe "C:\Documents and Settings\oMBra\Desktop\Nuovo AutoIt v3 Script (8).au3" C:\Programmi\AutoIt3\Include\BorderConstants.au3 (24) : ==> Variable used without being declared.: Global Const $BF_BOTTOMLEFT = BitOR($BF_BOTTOM,$BF_LEFT) Global Const $BF_BOTTOMLEFT = BitOR($BF_BOTTOM,^ ERROR Edited October 30, 2008 by oMBra Link to comment Share on other sites More sharing options...
zorphnog Posted October 30, 2008 Share Posted October 30, 2008 Runs fine on my computer. Try re-installing AutoIt. Link to comment Share on other sites More sharing options...
zorphnog Posted October 30, 2008 Share Posted October 30, 2008 Oh, if you copied that code from Malkey. It should be: Global Const $BDR_RAISEDOUTER = 0x1 Global Const $BDR_SUNKENOUTER = 0x2 Global Const $BDR_RAISEDINNER = 0x4 Global Const $BDR_SUNKENINNER = 0x8 Global Const $EDGE_BUMP = (BitOR($BDR_RAISEDOUTER,$BDR_SUNKENINNER)) Global Const $EDGE_ETCHED = (BitOR($BDR_SUNKENOUTER,$BDR_RAISEDINNER)) Global Const $EDGE_RAISED = (BitOR($BDR_RAISEDOUTER, $BDR_RAISEDINNER)) Global Const $EDGE_SUNKEN = (BitOR($BDR_SUNKENOUTER,$BDR_SUNKENINNER)) Global Const $BF_ADJUST = 0X2000 Global Const $BF_BOTTOM = 0X8 Global Const $BF_DIAGONAL = 0X10 Global Const $BF_FLAT = 0X4000 Global Const $BF_LEFT = 0X1 Global Const $BF_MIDDLE = 0X800 Global Const $BF_MONO = 0X8000 Global Const $BF_RIGHT = 0X4 Global Const $BF_SOFT = 0X1000 Global Const $BF_TOP = 0X2 Global Const $BF_BOTTOMLEFT = (BitOR($BF_BOTTOM,$BF_LEFT)) Global Const $BF_BOTTOMRIGHT = (BitOR($BF_BOTTOM,$BF_RIGHT)) Global Const $BF_DIAGONAL_ENDBOTTOMLEFT = (BitOR($BF_DIAGONAL,$BF_BOTTOM,$BF_LEFT)) Global Const $BF_DIAGONAL_ENDBOTTOMRIGHT = (BitOR($BF_DIAGONAL,$BF_BOTTOM,$BF_RIGHT)) Global Const $BF_DIAGONAL_ENDTOPLEFT = (BitOR($BF_DIAGONAL,$BF_TOP,$BF_LEFT)) Global Const $BF_DIAGONAL_ENDTOPRIGHT = (BitOR($BF_DIAGONAL,$BF_TOP,$BF_RIGHT)) Global Const $BF_RECT = (BitOR($BF_LEFT,$BF_TOP,$BF_RIGHT,$BF_BOTTOM)) Global Const $BF_TOPLEFT = (BitOR($BF_TOP,$BF_LEFT)) Global Const $BF_TOPRIGHT = (BitOR($BF_TOP,$BF_RIGHT)) The order of declaration makes a difference. Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 30, 2008 Share Posted October 30, 2008 Either the constants should be in the UDF that uses them, or the other UDF (BorderConstants.au3) should be included with it.Bug Trac #650 submitted. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
oMBRa Posted October 30, 2008 Author Share Posted October 30, 2008 now works all properly Link to comment Share on other sites More sharing options...
GaryFrost Posted October 30, 2008 Share Posted October 30, 2008 Either the constants should be in the UDF that uses them, or the other UDF (BorderConstants.au3) should be included with it.Bug Trac #650 submitted. _WinAPI_DrawEdgeRemarksNeeds BorderConstants.au3 for pre-defined constantsPretty sure the include is in the latest beta SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
oMBRa Posted October 30, 2008 Author Share Posted October 30, 2008 I have beta and BorderConstants.au3 is missing Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 31, 2008 Share Posted October 31, 2008 (edited) I have beta and BorderConstants.au3 is missingIt's not there in 3.2.13.9, but I think Gary meant the next Beta, 3.2.13.10, which us common hoi polloi don't have access to yet.At any rate, Bug Trac #650 is already flagged fixed for the 3.2.13.10 milestone. Edited October 31, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now