Jump to content

binhnx

Active Members
  • Posts

    122
  • Joined

  • Days Won

    1

binhnx last won the day on April 28 2014

binhnx had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

binhnx's Achievements

  1. So do you know hack? Are there something different from set the variable to 0 (which is, in AutoIt, also free the memory in which that variable is stored) and delete the variable pointer and memory (which is, also clean the memory)? When a hacker find the pointer, even you deleted it (the pointer only), she can read the memory pointed by it. Just free the memory as soon as you are done and you are safe. When you still operate with the variable you still expose the variable to hacker. All we can do is minimize the chance, we cannot prevent them.
  2. @mLipok: Yes, its not only for mySQL (1), and he can even use an older mySQL driver (2) with your UDF but I need some simple words (bind to the context we are discussing) so he can understand, especially he cannot read English well. @Rechard_Long: If you use @mLipok UDF, read his example so you will know how to retrieve the data. Take a look at the function _Example_1_RecordsetToConsole. Instead of using _ADO_Recordset_ToArray you can use _ADO_Recordset_ToString so you can use the result directly in GUICtrlCreateLabel
  3. If you want to display the password, you're not so lucky. Many framework use an addition layer to protect the password so when hackers have access to the database, they cannot also steal the password from it. In addition, the password cannot be revert to the plain text form. Unless the database and the code to populate data to the database is your code, I think you cannot get the real password -- Translate: Không được đâu sói ạ (don't be evil)
  4. Okay, so everything should be clear now. The @mLipok's mySQL UDF use the latest/ a newer version of mysql driver which use another authentication hashing method that your mysql database does not support, so you need to do some addition step with your database to update that hash (for instruction to solve the problem please follow the link in previous @mLipok's post) If you don't want to mesh with the database and if you use @tarretarretarre's UDF without any problem, just use it -- Translated by Google myself "Được rồi, mọi thứ rõ ràng rồi. UDF của @mLipok dùng với những phiên bản mới nhất của mysql driver, nó dùng phương pháp băm (hashing) khác để xác thực người dùng mà cơ sở dữ liệu mysql của bạn không hỗ trợ, vì vậy bạn cần phải làm một số bước bổ sung với cơ sở dữ liệu của bạn để cập nhật các hash đó (hướng dẫn để giải quyết vấn đề xin vui lòng làm theo các liên kết trong bài trước của @mLipok) Nếu không muốn động đến cơ sở dữ liệu và nếu bạn dùng @tarretarrentarre UDF mà không có vấn đề gì thì cứ dùng nó luôn đi"
  5. Hi @Rechard_Long I totally don't get it. You get data from a database, then you use GUICtrlCreatePic which can only support local file. Your SQL query is also invalid. For any problem, first ask "Ông chú Google" first, then search the forum before write a post to ask.
  6. Sorry, I misunderstood about StringRegExpReplace $output = StringRegExpReplace($str, '(<q\d+=")\d*(">)', '${1}907605${2}')
  7. $output = StringRegExpReplace($str, '<q\d+="(\d*)">', '907605') @namlunthkl: There're no need to bump the thread. There're many members but nobody can stay all the times in the forum to answer all the question. Just wait politely. If you want replace all the value to a single value, it's easy but you need the right regex pattern $output = StringRegExpReplace($str, '<q\d+="(\d*)">', '907605')
  8. Yes, and do it also for up and down key, you will see your game will respond to key press more accuracy and smoothly. Not sure why you still get flickering. I try editing some lines and the flickering gone: If $spawned = True Then _GDIPlus_GraphicsDrawLine($backbuffer,$ran_x_line+$x_rect,$ran_y_line+$y_rect,$ran_x_line+$x_rect,$ran_y_line_solid+$y_rect,$pen_barrel) EndIf Sleep(100) _GDIPlus_GraphicsDrawImageRectRect($hwnd, $bitmap, 0, 0, 640, 480, 0, 0, 640, 480) ;_GDIPlus_GraphicsDrawLine($backbuffer_2,0,0,100,100,$pen_body) ;_GDIPlus_GraphicsDrawImageRect($hwnd, $bitmap_2, $x_rect, $y_rect, 2000, 1000)
  9. You've misunderstand the term "multiple buffering". The flickering is cause by a sequence of slow-painting-action *directly* to the screen buffer. To solve the flickering issues, you actually need some kind of multiple buffering, in this case double buffering is enough. To be double buffered, the entire frame need to be paint to *one* buffer (back-buffer), that buffer will be flip/copy to the screen buffer (front-buffer) to show directly in the screen (eg. monitor), which you've done by using _GDIPlus_GraphicsDrawImageRectThat function should be called *only one* each time you finish with the back-buffer, because its the one which directly communicate with the front buffer. It seems that due to misunderstanding, you're using *2* buffers and then call copy function *twice*. With your 2000x1000 = 2Megapixel large buffer, with the low speed of GDI+ (all done by CPU, not by GPU acceleration), with two sequence call to it, all the condition are met to make your game flicker like crazy. So you need to use only one buffer. Calculate all the coordinates and paint the right thing to the right location in the back buffer, then copy it to the front buffer. Don't use 2 back buffers and copy twice. (Indeed, in triple-buffering, you also copy once and only once. There are 2 back buffers, but there is always (at a specified moment) only one back buffer to be painted to, and one to be swapped/copy to the front buffer. When the painting finished, we flip 2 back buffers) And a footnote: using loopy-based input model is quite rarely used in game development. Think like this, you and your friend need to meet to exchange some information. The correct way is, when you arrive at her house, you need to press doorbell (or phone her) so she know you've arrived. But a lot scripter did another way, they ask their girl-friends to go out and check for your arrival, say, every 100 milliseconds ('kay, in real world, it can be 15 mins or 2 hours interval) but its totally inefficient and unreliable. You can see that. If you busy all the day and can only come to her house at the very end of the day, so she need to go out and check several times to solve nothing. The more frequently she go out and looking for you, the more inefficient. Yes, you can ask her go out less frequently, but there are also a cavet: you can arrive at the time she is inside her house. Since 2 you have none method to communicate with each other, she don't know that you've arrived. And you, when don't see her outside, you also go back to your home without any information/gifts. Say the computer words, when your user press their keyboard button but your apps is currently executing this line Sleep(100)so the user's press event will silently killed. You can only *reduce* (not remove) the case the event loss by increase the frequency, but it effect the performance (more inefficient). Switch your app to event mode. Create some 'dummy' control in your GUI, and take a look at the GUISetAccelerators function. This way every event is catch when it comes, efficiently and reliability.
  10. You added the button to the last child? Should a GUISwitch() statement help?
  11. I'm happy to see your problem solved. Just a small notice: When you create a GUI with $WS_VISIBLE flag, you don't need to use GUISetState() to show it. Then the 2nd GUISetState() (after GUISetBkColor(0xFF0000, $test_child_gui)) could be safely removed.
  12. First, take a look >here (thread by @JakeJohnson74) And ensure that you are not possible to use only 1 GUI. If you can, do use 1. If you can't, continue to read. If you want all your GUI to be shown at once, you must use only 1 popup. Yes, multiple GUI but only 1 popup - your main GUI. So edit this: Global $test_child_gui = GUICreate("test child", 150, 150, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $test_gui) GUISetBkColor(0xFF0000, $test_child_gui) GUISetState(@SW_SHOW, $test_child_gui) to this: Global $test_child_gui = GUICreate("test child", 150, 150, 0, 0, BitOr($WS_CHILD, $WS_VISIBLE, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS), -1, $test_gui) GUISetBkColor(0xFF0000, $test_child_gui) Now if your child gui does not contain any control, you are OK. But it is does, you will have problem with tab select. Normally, you can press tab multiple times to navigate to every controls in your gui. But now you can't (also, it you use multiple popup child gui, you can't also). So what do you need to do now? It's quite complicated. First, you need $WS_EX_CONTROLPARENT Global $test_child_gui = GUICreate("test child", 150, 150, 0, 0, BitOr($WS_CHILD, $WS_VISIBLE, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS), $WS_EX_CONTROLPARENT, $test_gui) Run the code, and your red test_child_gui can now be dragable around your main gui. Surprise? Since AutoIt provide some hacky way to helps most people easier to script, its also make someone sad. In AutoIt, $WS_EX_CONTROLPARENT also make entire the gui dragable. So you need extra 1 step, handle WM_NCHITTEST and reset the default system behaviour: GUIRegisterMsg($WM_NCHITTEST, 'Wm_NcHittest') Func Wm_NcHittest($hWnd, $uMsg, $wParam, $lParam) If ($hWnd = $test_child_gui) Then ; Be sure to do this check or you will mess up with the msg handler like @JakeJohnson did) Return 1 EndIf Return $GUI_RUNDEFMSG EndFunc
  13. @LarsJ: You can also read this thread: Basically, yes, you can create a far more advanced forms with AutoIt, with a condition, you know what you're doing. The OP overuse the child window. With his problem, he should really using one form. But he not. So he totally mess with his resize code. (Yes it my fucking bad, the 2 tab controls make him cannot use only 1 form) Look at his GUI hierarchy: - MainForm ($hGui) - Toolbar - Nested child 1 ($hGui2) (using $WS_EX_MDICHILD,but then reposition manually by intercepting WM_SIZE) - Tab Control1 (This contain 2 tab items) - TreeView1 (contained in 1st tab item) - TreeView2 (contained in 2nd tab item) - Nested child 1.1 ($hGuiInner1) (again, a $WS_POPUP with $WS_EX_MDICHILD and manually position during resize). This is contained in the first item of the tab below tab - Nested tab, with 5 tab items - Nested child 1.2 ($hGuiInner2) (again, a $WS_POPUP with $WS_EX_MDICHILD and manually position during resize). This is positioned in the second item of the TabControl1 - Nested tab, with 2 items So what's going wrong? AutoIt intercept all its GUI message. Guess? When processing WM_SIZE, the OP resize all 3 Gui!!! Then? Let's look - First, main form, $hGUI is resized by user. The system send a WM_SIZE indicate that the window has been resized. - In response to it, the OP resize its direct child, $hGui2 and 2 nested: $hGuiInner1 and hGuiInner2 - $hGui2 resize make the system send another WM_SIZE, and he continue to resize $hGui2 here. It bad. - Its terrible but not disaster, he also resize 2 most nested child: $hGuiInner1 and $hGuiInner2 in his message handler. So bulks of WM_SIZE sent recursive here. Assume that the system code was fast enough or/and he's too lucky so he doesn't see the problems. - The disaster come in when he switch from system-handled-WM_NOTIFY to his own WM_NOTIFY handler. Each resize, multiple WM_NOTIFY is sent. So bulks of (unnecessary) resize * multiples of WM_NOTIFY = disaster. @To the OP: - Edit - : I re-read the tab control problem. So 1 Gui for all is not suitable here. So sorry! Just modify your WM_SIZE handler like this: Func WM_SIZE($hWndGUI, $MsgID, $wParam, $lParam) if ($hWndGUI = $hGui) Then _WinAPI_SetWindowPos($hgui1, 0, 0, 0, _WinAPI_LoWord($lParam)-$aOffsets_1[0]+16, _WinAPI_HiWord($lParam)-$aOffsets_1[1]+38,BitOR($SWP_NOMOVE, $SWP_NOZORDER)) ElseIf ($hWndGUI = $hgui1) Then _WinAPI_SetWindowPos($hGuiInner1, 0, 0, 0, _WinAPI_LoWord($lParam)-$aOffsets_inner1[0]+16, _WinAPI_HiWord($lParam)-$aOffsets_inner1[1]+38,BitOR($SWP_NOMOVE, $SWP_NOZORDER)) _WinAPI_SetWindowPos($hGuiInner2, 0, 0, 0, _WinAPI_LoWord($lParam)-$aOffsets_inner2[0]+16, _WinAPI_HiWord($lParam)-$aOffsets_inner2[1]+38,BitOR($SWP_NOMOVE, $SWP_NOZORDER)) EndIf Return $GUI_RUNDEFMSG EndFunc ;==> WM_SIZE And you will feel much better. PS: And also, take a look at the >thread by @TheDCoder, you will find a solution for the appearing order of your child Guis.
  14. @LarjS: It definitely cannot help. He fucks up the GUI hierarchy way too much. Edit: What make you (and DCoder) don't want to use a single GUI , as AutoIt designed to be? Two you use all the child windows the wrongest way!
  15. >this? Seems not relevant Edit: Read the thread. So why you need a separate window? (More clear, just add buttons - which act as menu - to your main window and everything is just fine)
×
×
  • Create New...