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

Вниз

ScrollBox и SpeedButton на API   Найти похожие ветки 

 
Velocity   (2002-10-18 20:59) [0]

Собственно сабж. Всем заранее спасибо, сам вот никак сэмплов найтить не могу.


 
Ev_genus   (2002-10-18 23:18) [1]

HWND CreateWindow(
LPCTSTR lpClassName, // registered class name
LPCTSTR lpWindowName, // window name
DWORD dwStyle, // window style
int x, // horizontal position of window
int y, // vertical position of window
int nWidth, // window width
int nHeight, // window height
HWND hWndParent, // handle to parent or owner window
HMENU hMenu, // menu handle or child identifier
HINSTANCE hInstance, // handle to application instance
LPVOID lpParam // window-creation data
);

lpClassName <- Это класс объекта.
Вот список системных классов:
BUTTON Designates a small rectangular child window that represents a button the user can click to turn it on or off. Button controls can be used alone or in groups, and they can either be labeled or appear without text. Button controls typically change appearance when the user clicks them. For more information, see Buttons.
For a table of the button styles you can specify in the dwStyle parameter, see Button Styles.

COMBOBOX Designates a control consisting of a list box and a selection field similar to an edit control. When using this style, an application should either display the list box at all times or enable a drop-down list box. If the list box is visible, typing characters into the selection field highlights the first list box entry that matches the characters typed. Conversely, selecting an item in the list box displays the selected text in the selection field. For more information, see Combo Boxes.
For a table of the combo box styles you can specify in the dwStyle parameter, see Combo Box Styles.

EDIT Designates a rectangular child window into which the user can type text from the keyboard. The user selects the control and gives it the keyboard focus by clicking it or moving to it by pressing the TAB key. The user can type text when the edit control displays a flashing caret; use the mouse to move the cursor, select characters to be replaced, or position the cursor for inserting characters; or use the BACKSPACE key to delete characters. For more information, see Edit Controls.
For a table of the edit control styles you can specify in the dwStyle parameter, see Edit Control Styles.

LISTBOX Designates a list of character strings. Specify this control whenever an application must present a list of names, such as file names, from which the user can choose. The user can select a string by clicking it. A selected string is highlighted, and a notification message is passed to the parent window. For more information, see List Boxes.
For a table of the list box styles you can specify in the dwStyle parameter, see List Box Styles.

MDICLIENT Designates an MDI client window. This window receives messages that control the MDI application"s child windows. The recommended style bits are WS_CLIPCHILDREN and WS_CHILD. Specify the WS_HSCROLL and WS_VSCROLL styles to create an MDI client window that allows the user to scroll MDI child windows into view. For more information, see Multiple Document Interface.
RichEdit Designates a Rich Edit version 1.0 control. This window lets the user view and edit text with character and paragraph formatting, and can include embedded COM objects. For more information, see Rich Edit Controls.
For a table of the rich edit control styles you can specify in the dwStyle parameter, see Rich Edit Control Styles.

RICHEDIT_CLASS Designates a Rich Edit version 2.0 control. This controls let the user view and edit text with character and paragraph formatting, and can include embedded COM objects. For more information, see Rich Edit Controls.
For a table of the rich edit control styles you can specify in the dwStyle parameter, see Rich Edit Control Styles.

SCROLLBAR Designates a rectangle that contains a scroll box and has direction arrows at both ends. The scroll bar sends a notification message to its parent window whenever the user clicks the control. The parent window is responsible for updating the position of the scroll box, if necessary. For more information, see Scroll Bars.
For a table of the scroll bar control styles you can specify in the dwStyle parameter, see Scroll Bar Control Styles.

STATIC Designates a simple text field, box, or rectangle used to label, box, or separate other controls. Static controls take no input and provide no output. For more information, see Static Controls.
For a table of the static control styles you can specify in the dwStyle parameter, see Static Control Styles.



 
Velocity   (2002-10-19 06:02) [2]

Сенькс, это конечно всё понятно, только вот не совсем это то, на что я рассчитывал. мне б примерчик... в хелпах я уже лазил, и функцию эту знаю, видел, но живой примерчик предпочтительнее. Но всё равно спасибо за помощь.


 
Evgeny   (2002-10-19 09:36) [3]

Собственно говоря тема SpeedButton`а в API уже обсуждалась. Нет такого понятия. Нечто подобное тому что есть в Delphi нужно отрисовывать самому, что ребята из Borland`а и делают. И такой пример также уже был. Воспользуйтесь поиском...

Хотя увы попробовал поискать сам. Видно на сайте проблемы со свободным местом - эта тема уже удалена и поиск ничего не дал.
Ладно.

Создаем кнопку с картинкой.
CreateWindow("BUTTON", "", BS_BITMAP or WS_CHILD or WS_VISIBLE, PosX, PosY, Width, Height, Window, ID, hInstance, NIL);
Загружаем картинку из ресурса
Btn_BMP := LoadBitmap(hInstance, "Btn");
Выводим ее на кнопку
SendDlgItemMessage(Wnd, 105, BM_SETIMAGE, IMAGE_BITMAP, Btn_BMP);

Ну вот примерно так.

ScrollBox также изобретение фирмы Borland, такого окна в API не существует. Можно конечно изобрести свое.

CreateWindow("edit", "", WS_CHILD or WS_VISIBLE or WS_VSCROLL, PosX, PosY, Width, Height, Window, ID, hInstance, NIL);

CreateWindow("richedit", "", WS_CHILD or WS_VISIBLE or WS_VSCROLL, PosX, PosY, Width, Height, Window, ID, hInstance, NIL);

Примерные варианты я привел. Дальше двигай сам.


 
Velocity   (2002-10-19 12:28) [4]

Уряяя! Спасибо огромное, а то стандартные элементы ещё знаю как ну там прогрессбар мутил, а эти два - ни в какую



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

Форум: "WinAPI";
Текущий архив: 2002.12.02;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.008 c
6-4549
Max2000
2002-10-03 10:49
2002.12.02
Подскажите как обмануть провайдера????


14-4614
evgeg
2002-11-11 15:36
2002.12.02
Житье в Канаде


1-4309
BJValentine
2002-11-21 11:25
2002.12.02
FindFirst, FindNext, FindClose


1-4381
Dmitry1
2002-11-22 14:00
2002.12.02
Размер активного окна


1-4336
skirdov
2002-11-20 17:02
2002.12.02
Как выполнить процедуру, имя которой содержится в переменной?





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский