Jump to content

Antiec

Active Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by Antiec

  1. I'm not sure if there's some other mistakes, but atleast you should add "Global $Pos" to the top of your script. Or use it as a parameter for your functions. At the moment you create a local variable $pos at _Mouse() which _EnterMission() can't see. Making it global makes it available for every function in your script.
  2. Thx, it does make a bit neater and taught me a bit about regexp syntax. I had a second problem too, but managed to fix it. I'd just like to know is it normal too and why. It's kinda weird... If I use this one, it will result in 'to port=" />' MsgBox( 0, "Test", StringRegExpReplace( '< to port="500" />', '(to port=)(.*)(" />)', "$1" & 6000 & "$3" ) ) But if I add the " quotation it does work. It seems to be the same always if I want to replace with numbers. MsgBox( 0, "Test", StringRegExpReplace( '< to port="500" />', '(to port=)(.*)(" />)', "$1" & '"' & 6000 & "$3" ) )
  3. Hi! I'm trying to replace some text in a string and I managed to make it work, but it's a bit weird. Why does the following function replace "test name=" too? Should it? How to format the regexp so it won't replace it? $1 has "test_5" so shouldn't it replace only that part? $name = "dummy_" for $i = 0 to 10 $strtest = StringRegExpReplace( 'test name="dummy_5"', 'test name="(.*)"', $name & $i ) MsgBox( 0, "Test", $strtest ) Next Ofcourse $strtest = StringRegExpReplace( 'test name="dummy_5"', 'test name="(.*)"', 'test name="' & $name & $i & '"' ) works but isn't as neat =/ Sorry for the typos
  4. Hi, I'm not so sure if I understood what you said. But I can read the file to get the current encoding, like "ISO_IR 13" which is "JIS_X0201" (yeah, I'm reading DICOM-files). So do you mean that if I want to recode the file from JIS_X0201, I have to search some gibberish symbols and replace them with the responding UTF-8 -characters? That would mean that I had to search for thousands of characters . I hoped there was some easier way to do it. Maybe we just have to leave it be. Thx, Lassi.
  5. Hi there! I have a little script which reads files in hex-mode, picks up some data and converts it to text with _HexToString(). It worked fine until I happened to bump into a file with the text with some special encoding like ISO-JIS or something (not UTF or ANSI). They're files which I can't edit or anything, so I'd need a way to re-encode the text. I also can read the file for the encoding information. So, is it possible to convert some random encoding to UTF or ANSI? Thx, Lassi
  6. Hi I'm trying to make a small group-minimize/maximize program and it kinda works. But one of the programs has a japanese title and no text. Should WinExists("魔女", "") work, and is there any way to make it work? Thx, Lassi
  7. Oh, cool! Didn't know that one... I managed to get it working by using double quotes ("") which isn't as nice to read. This one looks pretty awful: Run( @ComSpec & ' /K ""' & _CheckJavaPath("Java Runtime Environment\", $JAVA_CD_DIR) & '" -jar "' & @ScriptDir & '\bla.jar"' & " -param1 -param2 " & '"' & @ScriptDir & '\usethis.file""', @ScriptDir) Though my _CheckJavaPath-function returns the long name and should be altered too, and that means too much work! But I'll use FileGetShortName(@ScriptDir) in the future. Thx!
  8. RunWait(@Comspec & " bla.bat") only opens the cmd-prompt... Run(@Comspec & " /C bla.bat") runs the bat... Run(@Comspec & " /K bla.bat") runs the bat and pauses cmd-prompt, so I can see what the bat did (and this is what I want)... There's only one problem: using /K messes up the "" quotes badly. Like you can't use ( @comspec & " /K " & @scriptdir & "\bla.exe " & "-windowed" ) IF @scriptdir has spaces in it... without the "-windowed" parameter it works perfectly though...
  9. Hi once again! I couldn't find anything about this... so is it possible to give Run() function a pause command, just like if I'd use .bat with PAUSE in the end of the file. I have a little start-gui for my java program, which ofcourse opens a cmd-promt window when started. But something goes wrong and the cmd window just disappears instantly and I'd like to see if my java program gives some errors to the cmd-prompt. Is it possible or do I just have to use a .bat to test my run parameters. I wouldn't like to use bat, because I'd need to reconstruct my command from @scriptdir/@windir etc. to .bat and back... Thx, Lassi PS. Oh gosh... I tried "cmd /?" and found out that you can use "Run( @comspec & " /K ...." )". Maybe someone will have this problem and can find it with search... Sorry for bothering you =/
  10. Riiiiiiiiiight.... That was some of the weirdest sh*t ever. I tried converting it with different programs etc. but nothing helped. Before I decided to try a different filename. TSADANG!... And what's the weirdest thing in this problem is that I can only produce that error with the filename "planmeca.bmp" (which is the name of our company), but not with anything else... "planmec, planmeci" etc. all work perfectly. Anyway, thx for your help!
  11. What i meant was that It was originally JPG and I had already converted it to BMP. So it wasn't such a surprise that converting it to PNG and again back to BMP didn't help...
  12. Thx for the reply! It was originally .jpg format but _SetBitmapToCtrl() shouldn't work with those, right? I tried converting it to and back but it didn't help =/ Is there any way to use some other format with the wrapper?
  13. Yeah you can... I'll give you some hints so you can try to make it yourself. You should make function A using "While...Wend" loop, "Stringlen()", "Stringleft()", "StringTrimLeft()" to read 5 characters at time. Then you should make another function with "Switch...Case...EndSwitch" to check which letter the characters from A equals to.
  14. Yep, just use "GUICtrlSetState($BtnName, $GUI_DISABLE)" and $GUI_ENABLE... You could search the forums though, I'm sure someone has asked this before...
  15. Hi! I'm trying to use pictures from the compiled exe and I get the following error while compiling: ! RC.Exe (1) : Error :C:\DOCUME~1\xxxxx\LOCALS~1\Temp\temp.RC (2): error RC2170 : bitmap file test.bmp is not in 3.00 format ! RC.Exe (1) : Error : Resources information will not be updated in target program! I'm trying to use the following command: #AutoIt3Wrapper_Res_File_Add=test.bmp, bitmap, TestPic Does anyone know what the heck is 3.00 format bitmap? Or what should I do to make it working...
  16. Yeah, I didn't have that kind of problem either... So I kinda don't know how to fix it. Examples would help alotta...
  17. Are you using version 3.2.10.0? Does it leave an empty line at the every removed one or does it add one empty line to the first line on the file? The latter is a bug which is fixed on 3.2.11.0... You can fix it yourself on the File.au3 (make sure you backup it) while waiting for the 3.2.11.0 release.
  18. It really should work with Global $Label Func One() $Label = GUICtrlCreateLabel("Test", 10, 10) EndFunc Func Two() GuiCtrlDelete($Label) EndFunc because first you allocate memory for the $label and then you just change it's value, which is a handle to the label. Have you even tried it?
  19. Hmm... GUISwitch() needs WinHandle-parameter too. I used the same GUI1 = GUICreate as Monamo did, and Monamo uses GUISwitch(GUI1) on his example. It looks like GUISetState( @SW_HIDE, GUI2 ) changes the active window too, so it's a bit better to use. You should compare the two following examples: GUISetState (@SW_Hide, GUI1) GUISetState (@SW_Show, GUI2) GUISetState (@SW_Hide, GUI3) GUISetState (@SW_Show, GUI1) And GUISwitch($GUI1) GUISetState (@SW_Hide, "My GUI1") GUISwitch($GUI2) GUISetState (@SW_Show, "My GUI2") <--- Actually that "My GUI2" does nothing, and you can just use it like this... GUISwitch($GUI3) GUISetState (@SW_Hide) GUISwitch($GUI1) GUISetState (@SW_Show) As you can see, the first one is much shorter etc...
  20. Or you can use GUISetState, but you need the window handle for it, not "My GUI1". So it should work with the following code: #include <GUIConstants.au3> GUI1 = GUICreate("My GUI1", 200, 200, 100, 100) <---- See the GUI1 = before GUICreate... Like in Monamo's example. $Button1 = GUICtrlCreateButton("Button 1", 50, 50) GUISetState (@SW_SHOW) GUI2 = GUICreate("My GUI2", 200, 200, 320, 100) <---- Use it in the same way $Button2 =GUICtrlCreateButton("Button 2", 50, 50) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $Button1 then GUISetState (@SW_Hide, GUI1) <---- Use the GUI1 variable, which now has the window handle If $msg = $Button2 then GUISetState (@SW_Hide, GUI2) <---- returned by the GUICreate. If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend
  21. Have you tried _GUICtrlListViewSetItemText() & Co (check it from the help)? I believe that one should do what you need. Or are you trying to do something different? It's better to use _GUICtrlListView-functions for listviews... Edit: The function name was changed to _GUICtrlListView_SetItemText() in 3.2.9.3
  22. Ok, this way you can't tab into it, but you can still select text. Though you have code to prevent that already. And it looks a bit like you can't change styles afterwards or it will start tabbing into it. Anyways, change this: $Edit1 = GUICtrlCreateEdit($readme, 150, 10, $x - 150, $y - 200) GUICtrlSetBkColor($Edit1, 0xffffff);Set background to white for ease of reading GUICtrlSetStyle($Edit1, $WS_VSCROLL + $WS_HSCROLL + $ES_AUTOVSCROLL + $ES_AUTOHSCROLL + $ES_READONLY);Set scrollbars and read only
  23. You could always use those _GDIP_ functions from the Auto3Lib. They're Windows GDI+ functions and support opening tiffs etc. It works in a bit peculiar way, but I'll try to help if you can't make it work.
  24. Yeah, forgot about that one, but reading it with mode 16 didn't help. Maybe I'll just have to convert my script to c++ (which isn't nice considering about developing it etc. And I'm a noob with C). Or maybe I'll just forget about that thumbnail-thing. Though it would be great to find some way to make it work.
  25. Still haven't been able to do it... But I realized (or so I think) that it should be a bit same as using a string read from a file: #include <A3LGDIPlus.au3> $str = FileRead( "test.bmp" ) $BitToHBit = _GDIP_BitmapCreateHBITMAPFromBitmap( $str ) $hBitmap = _GDIP_BitmapCreateFromHBITMAP( $BitToHBit ) ... But this doesn't work either. Does anyone have any idea how to make it work with a string? This way I could read it from a pointer to a string and it would work /
×
×
  • Create New...