Old 16th November 2005, 00:31   #1
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
Help!! How to center config dialog ???

void config()
{
DialogBox(plugin.hDllInstance,MAKEINTRESOURCE(IDD_DIALOG1),plugin.hwndParent,ConfigProc);
}

I am using this for opening the configuration dialog, but dialog doesnt come centered, it start at top-left side, how can i make it to appear centered? Thanks alot
mydiz is offline   Reply With Quote
Old 16th November 2005, 03:27   #2
aceman118
Junior Member
 
Join Date: Nov 2005
Posts: 11
Is it the text in the IDD_DIALOG1 resource that you want centered or is it the actual config window you want centered on the screen? The first one is just a matter of editing the IDD_DIALOG1 resource in visual studio. (the .rc file you have included)
aceman118 is offline   Reply With Quote
Old 16th November 2005, 08:37   #3
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
i want to center the window actual config window
mydiz is offline   Reply With Quote
Old 16th November 2005, 08:38   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
you need to have the DS_CENTER style in the dialog's resource

-daz
DrO is offline   Reply With Quote
Old 17th November 2005, 08:02   #5
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
i dont want to center the dialog box on screen, i want to center it in general plugins's window, (i mean the place which we press config button.)
mydiz is offline   Reply With Quote
Old 17th November 2005, 18:59   #6
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Try in your WM_INITDIALOG:
PHP Code:
RECT rcPref;
HWND hwndPref GetNextWindow(hDlgGW_HWNDPREV);
GetClientRect(hwndPref, &rcPref);
MoveWindow(hDlg00rcPref.right/2rcPref.bottom/2TRUE); 
Play with the numbers


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump