Popular Post Professor_Bernd Posted April 10, 2021 Popular Post Share Posted April 10, 2021 (edited) An about dialog is a nice little thing, often hardly bigger than a message box and usually just a minor thing. But almost every program has an about dialog, if only to put its "stamp" on it, insert a contact address or a copyright. Then there are the thank you notes, which in the 00's liked to be spiced up with some great effects, like vertical ticker, like in the credits of a movie. But who likes to watch the credits of a movie? I think it's nicer if you can scroll the credits yourself, as fast and as slow as you want. So that's what it should be: An about dialog, where you can nicely display the name of the program with your own name, maybe show a version number, and with buttons and link labels you can click on, which will then open the web or email address. Oh yeah, and an area where you can express your thanks to everyone involved. So I searched the DE forum here and the EN forum for example codes for an about dialog with credits area. You would think that there should be a lot of them, because about dialogs already existed in the computer stone age. But far from it: I found only 2 code examples. Both dialogs lacked a credits area, but - yay! - there were LinkLabels. So I was one step further. Here in the forum I created a thread asking if someone could provide me with a nice About dialog. Even the first reply was promising and suggested using a RichEdit and loading an RTF file into it. Nice stuff. Unfortunately I had probably put my request too vague, because instead of the code for the about dialog I was only provided with a picture of the dialog. Based on the tips and suggestions I developed my own code and provide it here. The About dialog is relatively large and consists of a RichEdit that takes up the left and middle areas of the dialog. In the right area there are labels and buttons. In the RichEdit you can show an about text as well as the credits, which you can scroll through manually. Preview Settings I tried to keep the configuration simple. Probably it would have become rather complex to gather all configuration options in one place. Now it became 3 different places, which I marked with double lines well visibly and the code remained clear. To set your own settings, it is sufficient to make changes in these areas. So settings for the title bar and the right area with the labels and buttons can be made. Settings for the text in RichEdit are made in the RTF file, also links for web and e-mail addresses are set up in the RTF file. The finished file is then simply loaded into RichEdit. The path to the RTF file can be customized in the code in the first settings area. Relative paths are possible, e.g. "..\..\About.rtf". I have added an example RTF file: "About.rtf". My example RTF file was created with "LibreOffice Writer". Probably you can open it with any higher office program and design it according to your own ideas. Unfortunately, I don't have MS Office available at the moment to check this. Important: With MS WordPad you cannot edit the existing example RTF file! (The data will be unreadable). But you can create your own RTF file with MS WordPad and use it in the about dialog. The same applies to MS Office: If the existing RTF file cannot be edited, simply create a new one and design it according to your own wishes. Feedback is welcome. Version 0.0.12.2 First published Version. Version 0.0.12.5 Added: Ability to display the RichEdit with or without borders. Bugfix: When you scrolled the RichEdit with the scrollbar, the text and the scrollbar flickered. - Thanks to UEZ for finding this issue. 👍 Version 0.0.12.6 Added: Hide caret when the RichEdit is scrolled with the scrollbar. Nevertheless, the caret sometimes flashes a little when scrolling. Bugfix: Converted the background color value for the RichEdit from RGB to BGR. About Dialog 0.0.12.6 (Professor Bernd).zip Edited April 12, 2021 by Professor_Bernd Werty, Musashi, t0nZ and 2 others 4 1 Link to comment Share on other sites More sharing options...
UEZ Posted April 11, 2021 Share Posted April 11, 2021 It's a nice old school design. The GUI is flickering when scrolling the text only using the scrollbar. What about an automatic slow scrolling of the text until user intervention? Might be a good idea to add a small tune. Professor_Bernd 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
pixelsearch Posted April 11, 2021 Share Posted April 11, 2021 Hi UEZ Does it still flicker on your computer if you add the $WS_EX_COMPOSITED extended style ? $g_hGui = GUICreate($sGuiTitle, 640, 360, -1, -1, BitOR($WS_CAPTION, $WS_POPUPWINDOW), -1, $g_hParent) becoming $g_hGui = GUICreate($sGuiTitle, 640, 360, -1, -1, BitOR($WS_CAPTION, $WS_POPUPWINDOW), $WS_EX_COMPOSITED, $g_hParent) Link to comment Share on other sites More sharing options...
UEZ Posted April 11, 2021 Share Posted April 11, 2021 (edited) Yes, it's still flickering. Edited April 11, 2021 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Nine Posted April 11, 2021 Share Posted April 11, 2021 22 minutes ago, pixelsearch said: Does it still flicker on your computer if you add the $WS_EX_COMPOSITED extended style ? In Win7 it does not flicker but the scroll bar is not moving ! Professor_Bernd 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
pixelsearch Posted April 11, 2021 Share Posted April 11, 2021 These repeated tests I did here and there, based on $WS_EX_COMPOSITED, seem to confirm that it worked fine until Win7 included (at least for the flickering part). After Win7, it's not useful anymore, a real pity... Link to comment Share on other sites More sharing options...
Nine Posted April 11, 2021 Share Posted April 11, 2021 @pixelsearch Does the scrollbar move in you case with Win7 ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
pixelsearch Posted April 11, 2021 Share Posted April 11, 2021 No it doesn't, just like you Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 11, 2021 Author Share Posted April 11, 2021 Thanks for "Thanks" and "Likes"! 3 hours ago, UEZ said: It's a nice old school design. Thanks a lot! (Actually, I thought the design was quite modern, but apparently my idea of "modern" is as outdated as I am). 3 hours ago, UEZ said: What about an automatic slow scrolling of the text until user intervention? Might be a good idea to add a small tune. I'm not sure if that won't be too much. Let's see. Thanks for the ideas! 3 hours ago, UEZ said: The GUI is flickering when scrolling the text only using the scrollbar. This is because of $WS_EX_TRANSPARENT. ($ES_AUTOVSCROLL is also not needed). The following workaround should help: Remove/comment out the lines with $WS_EX_TRANSPARENT and add the other two lines, as in the following code snippet. ; $g_hRichEdit = _GUICtrlRichEdit_Create($g_hGui, "", 10, 10, 440, 340, _ ; BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY), $WS_EX_TRANSPARENT) $g_hRichEdit = _GUICtrlRichEdit_Create($g_hGui, "", 10, 10, 440, 340, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_READONLY)) _GUICtrlRichEdit_SetBkColor($g_hRichEdit, 0xC0C0C0) ; medium light gray 0xC0C0C0 After that it is a nice design of the even older school, because the RichEdit gets a frame. Does anyone know how to remove the frame so that the RichEdit looks flat? Or is it possible to unflicker the RichEdit despite transparency? Link to comment Share on other sites More sharing options...
pixelsearch Posted April 11, 2021 Share Posted April 11, 2021 1 hour ago, Professor_Bernd said: Does anyone know how to remove the frame so that the RichEdit looks flat? Hi Professor_Bernd Just remove the default $WS_EX_CLIENTEDGE extended style applied to the rich edit control $WS_EX_CLIENTEDGE : "Specifies that a window has a border with a sunken edge." $g_hRichEdit = _GUICtrlRichEdit_Create($g_hGui, "", 10, 10, 440, 340, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_READONLY)) becoming $g_hRichEdit = _GUICtrlRichEdit_Create($g_hGui, "", 10, 10, 440, 340, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_READONLY), 0) Professor_Bernd 1 Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 11, 2021 Author Share Posted April 11, 2021 Cool! 😎 I found a solution here and here to change the ExStyle after creating the RichEdit. But that is not necessary here. So I'm using your tip that removes the border already when creating the RichEdit. I'll include a switch to select whether the RichEdit should have a frame or not. Thanks to all the contributors! 👍 - Now you are also in the credits. - pixelsearch 1 Link to comment Share on other sites More sharing options...
pixelsearch Posted April 11, 2021 Share Posted April 11, 2021 Thx Professor_Bernd I was lucky to find this extended style using Yashied's tool (reworked to add control styles names) : Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 11, 2021 Author Share Posted April 11, 2021 13 minutes ago, pixelsearch said: Yashied's tool (reworked to add control styles names) Looks very interesting, could be useful. Where can you get this? ---- Before I upload the changed, flicker-free version of the About dialog, there's one tiny little thing: when you move the scrollbar, the caret is displayed in RichEdit as long as you hold the scrollbar. If someone knows a solution for this, I'll add it. Link to comment Share on other sites More sharing options...
pixelsearch Posted April 11, 2021 Share Posted April 11, 2021 (edited) 2 hours ago, Professor_Bernd said: Where can you get this? Yashied's original script has been reworked and is now maintained by argumentum. Thread got 9 pages, last update in this link 2 hours ago, Professor_Bernd said: the caret is displayed in RichEdit as long as you hold the scrollbar I read in the forum that hiding the caret is often problematic, though a radical solution seems to work, in a script where you don't have to type anything in input/edit fields : GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ;============================================================================== Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom = $lParam ; Handle to any CONTROL window DllCall($g_hUser32DLL, 'int', 'HideCaret', 'hwnd', $hWndFrom) Return $GUI_RUNDEFMSG EndFUnc Edited April 11, 2021 by pixelsearch Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 12, 2021 Author Share Posted April 12, 2021 2 hours ago, pixelsearch said: Yashied's original script has been reworked and is now maintained by argumentum. Thread got 9 pages, last update in this link Thanks for the info and the link. 2 hours ago, pixelsearch said: Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) ... DllCall($g_hUser32DLL, 'int', 'HideCaret', 'hwnd', $hWndFrom) It's crazy. This function alone does not cause the caret to be hidden. But with the other functions I use in the about dialog, it does just the last bit I was looking for: It hides the caret when you scroll with the scrollbar. Only when you scroll back and forth quickly does the caret flash a little. Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 12, 2021 Author Share Posted April 12, 2021 (edited) Version 0.0.12.6 - Can someone test if everything works now and nothing flickers? Edited April 12, 2021 by Professor_Bernd Link to comment Share on other sites More sharing options...
Gianni Posted April 12, 2021 Share Posted April 12, 2021 everything seems to work and nothing flickers here (win10) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
UEZ Posted April 12, 2021 Share Posted April 12, 2021 Confirmed - no flickering at all. Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
pixelsearch Posted April 12, 2021 Share Posted April 12, 2021 No flickering, good job Prof. Link to comment Share on other sites More sharing options...
Professor_Bernd Posted April 12, 2021 Author Share Posted April 12, 2021 Thanks to you guys for helping and testing! 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