Madza91 Posted November 2, 2007 Share Posted November 2, 2007 Hi, i want to know how to add this "button" like on picture to minimize to tray? :| [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Achilles Posted November 2, 2007 Share Posted November 2, 2007 (edited) One long solution would be to make your entire GUI by yourself. I've never seen a GUI with a button like that though... Edited November 2, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Madza91 Posted November 2, 2007 Author Share Posted November 2, 2007 That is "MyPhoneExplorer" software... download that program and see [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Vindicator209 Posted November 3, 2007 Share Posted November 3, 2007 (edited) Ahh, I've always had trouble with gui, and what I do for something like that is to make a popup/tool window GUI, and make the border on you own(using images)then make images for the buttons and set your actions to those pictures as if they were buttons. I'll share some of mine if you'd like Edited November 3, 2007 by MethodZero [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Madza91 Posted November 3, 2007 Author Share Posted November 3, 2007 send me pm [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Vindicator209 Posted November 4, 2007 Share Posted November 4, 2007 (edited) I tried to but my computer won't let me send PMs for some reason, I hit send but it freezes at a white screen so I'll just post it here. This is an example of some Myspace Spamming program(irrevlant), but notice how I skinned the title bar using images, and setting images as buttons, also, you can recreate the title bar drag by using the Drag() Function ;code code code Case $Pic1 Drag() ;more code Func Drag() dllcall("user32.dll","int","ReleaseCapture") dllcall("user32.dll","int","SendMessage","hWnd", $Forma,"int",0xA1,"int", 2,"int", 0) EndFunc You'll have to make your own skin, though. Thats always a drag. I wonder if I can delete downloads, i've hit my limit already...Example.rar Edited November 4, 2007 by MethodZero [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Madza91 Posted November 4, 2007 Author Share Posted November 4, 2007 Thank you [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Vindicator209 Posted November 4, 2007 Share Posted November 4, 2007 oh, P.S. You'll want to extract that, otherwise itll do some weird stuff (like opening and closing a command prompts? I didn't program that in there....) [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Madza91 Posted November 4, 2007 Author Share Posted November 4, 2007 I see that [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Zedna Posted November 4, 2007 Share Posted November 4, 2007 (edited) Here is Delphi elegant solutiom: expandcollapse popupunit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons; type TForm1 = class(TForm) procedure FormResize(Sender: TObject); private { Private declarations } TitleButton: TRect; procedure DrawTitleButton; procedure WMSetText(var Msg: TWMSetText); message WM_SETTEXT; procedure WMNCPaint(var Msg: TWMNCPaint); message WM_NCPAINT; procedure WMNCActivate(var Msg: TWMNCActivate); message WM_NCACTIVATE; procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST; procedure WMNCLButtonDown(var Msg: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; public { Public declarations } end; var Form1: TForm1; const htTitleBtn = htSizeLast + 1; implementation {$R *.dfm} procedure TForm1.DrawTitleButton; var bmap: TBitmap; XFrame, XTtlBit, YTtlBit: Integer; begin XFrame := GetSystemMetrics(SM_CXFRAME); XTtlBit := GetSystemMetrics(SM_CXSIZE); YTtlBit := GetSystemMetrics(SM_CYSIZE); TitleButton := Bounds(Width - XFrame - 4*XTtlBit + 2, XFrame + 2 , XTtlBit - 4 , YTtlBit - 4); Canvas.Handle := GetWindowDC(Self.Handle); try DrawButtonFace(Canvas, TitleButton, 1, bsAutoDetect, False, False, False); bmap := TBitmap.Create; bmap.LoadFromFile('info.bmp'); TitleButton.Left := TitleButton.Left + 2; TitleButton.Top := TitleButton.Top + 2; TitleButton.Right := TitleButton.Right - 2; TitleButton.Bottom := TitleButton.Bottom - 2; Canvas.StretchDraw(TitleButton, bmap); finally ReleaseDC(Self.Handle, Canvas.Handle); bmap.Free; Canvas.Handle := 0; end; end; procedure TForm1.WMNCActivate(var Msg: TWMNCActivate); begin Inherited; DrawTitleButton; end; procedure TForm1.FormResize(Sender: TObject); begin Perform(WM_NCACTIVATE, Word(Active), 0); end; procedure TForm1.WMNCPaint(var Msg: TWMNCPaint); begin Inherited; DrawTitleButton; end; procedure TForm1.WMSetText(var Msg: TWMSetText); begin Inherited; DrawTitleButton; end; procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest); begin Inherited; with Msg do if PtInRect(TitleButton, Point(XPos - Left, YPos - Top)) then Result := htTitleBtn; end; procedure TForm1.WMNCLButtonDown(var Msg: TWMNCLButtonDown); begin inherited; if (Msg.HitTest = htTitleBtn) then ShowMessage('Button was activated'); end; end. EDIT: here is code for DrawButtonFace expandcollapse popup{ DrawButtonFace - returns the remaining usable area inside the Client rect.} function DrawButtonFace(Canvas: TCanvas; const Client: TRect; BevelWidth: Integer; Style: TButtonStyle; IsRounded, IsDown, IsFocused: Boolean): TRect; var NewStyle: Boolean; R: TRect; DC: THandle; begin NewStyle := ((Style = bsAutoDetect) and NewStyleControls) or (Style = bsNew); R := Client; with Canvas do begin if NewStyle then begin Brush.Color := clBtnFace; Brush.Style := bsSolid; DC := Canvas.Handle; { Reduce calls to GetHandle } if IsDown then begin { DrawEdge is faster than Polyline } DrawEdge(DC, R, BDR_SUNKENINNER, BF_TOPLEFT); { black } DrawEdge(DC, R, BDR_SUNKENOUTER, BF_BOTTOMRIGHT); { btnhilite } Dec(R.Bottom); Dec(R.Right); Inc(R.Top); Inc(R.Left); DrawEdge(DC, R, BDR_SUNKENOUTER, BF_TOPLEFT or BF_MIDDLE); { btnshadow } end else begin DrawEdge(DC, R, BDR_RAISEDOUTER, BF_BOTTOMRIGHT); { black } Dec(R.Bottom); Dec(R.Right); DrawEdge(DC, R, BDR_RAISEDINNER, BF_TOPLEFT); { btnhilite } Inc(R.Top); Inc(R.Left); DrawEdge(DC, R, BDR_RAISEDINNER, BF_BOTTOMRIGHT or BF_MIDDLE); { btnshadow } end; end else begin Pen.Color := clWindowFrame; Brush.Color := clBtnFace; Brush.Style := bsSolid; Rectangle(R.Left, R.Top, R.Right, R.Bottom); { round the corners - only applies to Win 3.1 style buttons } if IsRounded then begin Pixels[R.Left, R.Top] := clBtnFace; Pixels[R.Left, R.Bottom - 1] := clBtnFace; Pixels[R.Right - 1, R.Top] := clBtnFace; Pixels[R.Right - 1, R.Bottom - 1] := clBtnFace; end; if IsFocused then begin InflateRect(R, -1, -1); Brush.Style := bsClear; Rectangle(R.Left, R.Top, R.Right, R.Bottom); end; InflateRect(R, -1, -1); if not IsDown then Frame3D(Canvas, R, clBtnHighlight, clBtnShadow, BevelWidth) else begin Pen.Color := clBtnShadow; PolyLine([Point(R.Left, R.Bottom - 1), Point(R.Left, R.Top), Point(R.Right, R.Top)]); end; end; end; Result := Rect(Client.Left + 1, Client.Top + 1, Client.Right - 2, Client.Bottom - 2); if IsDown then OffsetRect(Result, 1, 1); end; Edited November 5, 2007 by Zedna Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Madza91 Posted November 5, 2007 Author Share Posted November 5, 2007 I don't have Deplhi :/ [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
therks Posted November 5, 2007 Share Posted November 5, 2007 @Zedna: Could you post a screenshot of what that code produces? I'm curious. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
JustinReno Posted November 5, 2007 Share Posted November 5, 2007 I'm not sure, but why not create a picture control up there? Link to comment Share on other sites More sharing options...
Generator Posted November 5, 2007 Share Posted November 5, 2007 I'm not sure, but why not create a picture control up there?But then you will have to create a picture control for everything up there, because a control cannot be create "outside" of the grey area. Link to comment Share on other sites More sharing options...
Zedna Posted November 5, 2007 Share Posted November 5, 2007 I don't have Deplhi :/You can look at principles/used API functions and make something like that in AutoIt. Resources UDF  ResourcesEx UDF  AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted November 5, 2007 Share Posted November 5, 2007 (edited) @Zedna: Could you post a screenshot of what that code produces? I'm curious.Here it is.EDIT:I tested it and there must be implemented also Maximinize/restore messages in similar way like WMSetText to it correct.Also to be it absolutely perfect there should be implemented painting button in "Down" state when it's clicked.info.bmp Edited November 5, 2007 by Zedna Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
therks Posted November 5, 2007 Share Posted November 5, 2007 Thanks, that looks pretty good. I'll have to look into this further when I get a chance. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Vindicator209 Posted November 6, 2007 Share Posted November 6, 2007 I'm not sure, but why not create a picture control up there?Thats what I recommended... [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Madza91 Posted November 13, 2007 Author Share Posted November 13, 2007 Ok... ... i have another question .. . And this question is how to add this like on picture but from this picture:I don't know how to add icon 32x32 in listview item :/ [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Valuater Posted November 14, 2007 Share Posted November 14, 2007 Maybe... #include <GUIConstants.au3> ; Picture location Dim $Picture1 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_01.bmp" Dim $Picture2 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_02.bmp" Dim $Picture3 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_03.bmp" GUICreate("listview pics", 400, 200 ) $XSkin_lst = GuiCtrlCreateListView ("",10,10,120,150) GUICtrlSetStyle(-1, BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL)) for $x = 1 to 5 GUICtrlCreateListViewItem("Picture Here", $XSkin_lst) GUICtrlSetImage(-1, $Picture1, 0) GUICtrlCreateListViewItem("Another Here", $XSkin_lst) GUICtrlSetImage(-1, $Picture2, 0) GUICtrlCreateListViewItem("Guess what's Here", $XSkin_lst) GUICtrlSetImage(-1, $Picture3, 0) Next $button = GuiCtrlCreateButton ("Select-a-Pic",10,170,100,20) GuiSetState() Do $msg = GuiGetMsg () If $msg = $button Then MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($XSkin_lst)),2) Until $msg = $GUI_EVENT_CLOSE 8) 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