![]() |
|
Модераторы: Poseidon, Snowy, bems, MetalFan |
![]()
|
|
| dead_ricky |
|
|||
|
Шустрый ![]() Профиль Группа: Участник Сообщений: 62 Регистрация: 4.4.2002 Репутация: нет Всего: 1 |
Народ, скажите плззз, как создать окно в ручную, без помощи VCL.
Ну с кнопакими разумеется и всем чем надо, разумеется, или скажите где почитать можно.... З.Ы. Зараннее благодарен. |
|||
|
||||
| Vit |
|
|||
![]() Vitaly Nevzorov ![]() ![]() ![]() ![]() Профиль Группа: Экс. модератор Сообщений: 10964 Регистрация: 25.3.2002 Где: Chicago Репутация: 48 Всего: 207 |
Вот пример взятый с www.torry.net:
Комментарии автора: A M I G R E E N T E S T W I N D O W 1 . 0 0 ----------------------------------------------- I N T R O D U C T I O N ----------------------- Amigreen TestWindow was made as an experiment and example of how to create a "small-size" application. First I made a simpel program in Delphi on the "standard" way. Then I started to build the program _from scratch_. I maneged to "shrink" the app. from 212kb to only 16,6kb. I "saved" 196kb!!!!! C O M M E N T S O N T H E C O D E --------------------------------------- First thing to do is to create the main window: 1. Registrering a custom class for the Window. (The registrered class is automatically unregistered when the application terminates.) 2. Creating the window by using CreateWindowEx. Next is to create all the controls in the window: 1. Using CreateWindow(Ex) to create the button, edit and label. - It is important that you create the controls as childs. Now I want to change the font - the default is too big: 1. Create a font handle using CreateFont. 2. Send a WM_SETFONT to every control. The UpdateWindow draws the components at the same time, so you don't get a build-up look, when the app. starts. The messageloop ensures that the application does not terminate by it self. WindowProc function: All messages sent to the application is sent to the function specified in the TWndClass structure. D I S C L A I M E R ------------------- This code/program can be distributed freely as long as the author's name (Janus N. T?ndering, Amigreen Software) is present in both code and readme. C O N T A C T I N F O ----------------------- You can contact with questions about TestWindow or corrections or just if you want to give me your opinion. My email address is: [email protected] My homepage is at: http://www.crosswinds.net/denmark/~amigreen/ (finished in Feb. 1999) Copyright © Amigreen Software 1998 -------------------- With the best wishes, Vit I have done so much with so little for so long that I am now qualified to do anything with nothing Самый большой Delphi FAQ на русском языке здесь: www.drkb.ru |
|||
|
||||
| dead_ricky |
|
|||
|
Шустрый ![]() Профиль Группа: Участник Сообщений: 62 Регистрация: 4.4.2002 Репутация: нет Всего: 1 |
Спасибо!!!
А еще вопрос: Как обработатть нажатие клавиши Enter в Edit1 (из выше приведенного примера). З.Ы. Зараннее спасибо. |
|||
|
||||
| Vit |
|
|||
![]() Vitaly Nevzorov ![]() ![]() ![]() ![]() Профиль Группа: Экс. модератор Сообщений: 10964 Регистрация: 25.3.2002 Где: Chicago Репутация: 48 Всего: 207 |
Я с этим кодом не разбирался, да и не люблю я этих штучек, просто не понимаю зачем это городить, а не использовать VCL, но исходя из общих соображений надо обрабатывать посылаемые сообщения. Впочем в примере нажатие кнопки обрабатывается - вот и посмотри как...
-------------------- With the best wishes, Vit I have done so much with so little for so long that I am now qualified to do anything with nothing Самый большой Delphi FAQ на русском языке здесь: www.drkb.ru |
|||
|
||||
| dead_ricky |
|
|||
|
Шустрый ![]() Профиль Группа: Участник Сообщений: 62 Регистрация: 4.4.2002 Репутация: нет Всего: 1 |
Усё я просёк поляну...
Надо переопределить оконную процедуру компонента (Edit1), и обрабатывать там нужное сообщение... Пример нашел на www.torry.net З.Ы. Спасибо тебе Vit |
|||
|
||||
![]()
|
| Правила форума "Delphi: Общие вопросы" | |
|
|
Запрещается! 1. Публиковать ссылки на вскрытые компоненты 2. Обсуждать взлом компонентов и делиться вскрытыми компонентами
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Snowy, MetalFan, bems, Poseidon, Rrader. |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
| 0 Пользователей: | |
| « Предыдущая тема | Delphi: Общие вопросы | Следующая тема » |
|
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |