Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2002.01.21;
Скачать: [xml.tar.bz2];

Вниз

Окно программы....   Найти похожие ветки 

 
VadX   (2002-01-03 21:22) [0]

Как сделать нестандартное окно для своей программы (типа WinAmp, Sonique, Zone Alarm и тд...)?


 
Raven   (2002-01-04 09:35) [1]

Всё очень просто, если я правильно всё понял. Задача такова: надо сделать необычной формы окно и наложить на него скин. Ну что касается скина, то это можно сделать по разному: например наложить рисунок, в самом простом варианте TImage, а изменить форму окна можно API функцией SetWindowRgn. Help по функции привожу ниже:

SetWindowRgn
The SetWindowRgn function sets the window region of a window. The window region determines the area within the window where the system permits drawing. The system does not display any portion of a window that lies outside of the window region

int SetWindowRgn(
HWND hWnd, // handle to window whose window region is to be set
HRGN hRgn, // handle to region
BOOL bRedraw // window redraw flag
);

Parameters
hWnd
Handle to the window whose window region is to be set.
hRgn
Handle to a region. The function sets the window region of the window to this region.
If hRgn is NULL, the function sets the window region to NULL.

bRedraw
Boolean value that specifies whether the system redraws the window after setting the window region. If bRedraw is TRUE, the system does so; otherwise, it does not.
Typically, you set bRedraw to TRUE if the window is visible.

Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT/2000: To get extended error information, call GetLastError.

Remarks
If the bRedraw parameter is TRUE, the system sends the WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages to the window.

The coordinates of a window"s window region are relative to the upper-left corner of the window, not the client area of the window.

After a successful call to SetWindowRgn, the system owns the region specified by the region handle hRgn. The system does not make a copy of the region. Thus, you should not make any further function calls with this region handle. In particular, do not delete this region handle. The system deletes the region handle when it no longer needed.

To obtain the window region of a window, call the GetWindowRgn function.

QuickInfo
Windows NT/2000: Requires Windows NT 3.51 or later.
Windows 95/98: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Import Library: Use user32.lib.

See Also
Painting and Drawing Overview, Painting and Drawing Functions, GetWindowRgn, WM_WINDOWPOSCHANGING



 
Nikolay   (2002-01-04 13:55) [2]

With ImageFormMain.Picture.Bitmap Do
For Y := 0 To Height-1 Do
For X := 0 To Width-1 Do
If Canvas.Pixels[X,Y] <> Canvas.Pixels[0,0] Then
Begin If X1=-1 Then X1 := X; End
Else
If X1>-1 Then
Begin
CombineRgn(R,R,CreateRectRgn(X1,Y,X-1,Y+1),RGN_OR);
X1 := -1;
End;
SetWindowRgn(Handle, R, True);


 
Red Alert   (2002-01-04 16:25) [3]

Не забивай голову! Для этого можно воспользоваться компонентами ABC for Delphi 5


 
Nikolay   (2002-01-04 17:52) [4]

2 Red Alert

несогласен. при использовании компонентов ты получишь рост в размере программы, а тут несколько строчек .....


 
Red Alert   (2002-01-04 17:58) [5]

Тоже верно!


 
VadX   (2002-01-04 19:11) [6]

Спасибо всем!


 
Muxec   (2002-01-04 19:34) [7]

Form.border:=none



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2002.01.21;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.003 c
1-66303
msys
2002-01-02 18:21
2002.01.21
SaveDialog


6-66318
lun
2001-10-26 09:17
2002.01.21
Поделитесь исходниками прокси! пожалуйста!


6-66327
Юра
2001-10-29 13:18
2002.01.21
О TIdMappedPortTCP


4-66410
Moscower
2001-11-16 16:13
2002.01.21
Помогите найти ошибку


1-66313
Strelok
2002-01-02 16:15
2002.01.21
Хорошие книги по Дельфи





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский