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

Вниз

Как   Найти похожие ветки 

 
.: Joiro :.   (2002-01-19 13:12) [0]

Subj и есть вопрос - у меня на форме стоит Shape и надо сделать так, что если кликнуть внутри его и ташить мышь то за пределы не пойдёт. Я могу что-то другое удержывать (происходит перетаскивание чего-то), но не сам курсор, а надо как раз это.

Может кто знает? Зараенее спасибо.


 
Serghei   (2002-01-19 15:14) [1]

Читай в хелпе про: КлипКурсор!

The ClipCursor function confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by the SetCursorPos function or the mouse) lies outside the rectangle, Windows automatically adjusts the position to keep the cursor inside the rectangular area.

BOOL ClipCursor(

CONST RECT *lpRect // pointer to structure with rectangle
);


Parameters

lprc

Points to the RECT structure that contains the screen coordinates of the upper-left and lower-right corners of the confining rectangle. If this parameter is NULL, the cursor is free to move anywhere on the screen.



Return Values

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError
.

Remarks

The cursor is a shared resource. If an application confines the cursor, it must release the cursor by using ClipCursor before relinquishing control to another application.
The calling process must have WINSTA_WRITEATTRIBUTES access to the window station.

See Also

GetClipCursor, GetCursorPos, RECT, SetCursorPos

Удачи


 
.: Joiro :.   (2002-01-19 15:34) [2]

Во! Спасибо. А то я искал по "Set cursor position" и ничего дельного не нашёл. Иду пробовать... :)


 
Serghei   (2002-01-19 15:37) [3]

Давай-Давай! :o)))
Удачи!


 
.: Joiro :.   (2002-01-19 15:56) [4]

Даа... я всё же застрял в стадии чайника - не удаётся правильно установить область - прямоугольник. Может можно пример, если не трудно?


 
.: Joiro :.   (2002-01-19 21:09) [5]

ОТБОЙ. :)

Окей, разобрался всё же! Простые прямоугольники можно переделать в WinAPI дружественние прямоугольники при помоши символа @. Ещё раз спасибо за наводку.

Если интересно что же получилось, то вот скриншот (да, ненормально - чайник делает какую-то странную штуковину): http://www.ltn.lv/~joiro/SG.PNG
Теперь когда удержывается кнопка курсор не покидает картинку и можно рисовать. Хей! :)


 
Serghei   (2002-01-21 09:26) [6]

Если бы ты был чайником то не делал бы эти вещи :о)))) не надо себя недооценивать :о))))


 
Serghei   (2002-01-21 09:29) [7]

Да еще одно можешь передавать через @ или же объявить переменную типа указателя r : PRect;

Удачи



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

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

Наверх





Память: 0.46 MB
Время: 0.004 c
7-9018
Spiritbad
2001-10-25 12:47
2002.02.04
Про порты.


3-8755
Юрий Жуков
2002-01-04 18:00
2002.02.04
Oracle + DOA. Не могу остановить TOracleEvent


1-8873
Turalyon
2002-01-15 09:44
2002.02.04
Динамические объекты


1-8871
Stror
2002-01-13 12:16
2002.02.04
WebBrowser


14-8973
Fay
2001-12-10 06:50
2002.02.04
Что означает слово





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