Jump to content
Sign in to follow this  
Madza91

Set Cursor No. 2

Recommended Posts

Madza91

Hello, maybe you think it is noob question, but I think it isn't :mellow:

I want to set Cursor crDrag for some Ctrl, and this I can with this Func GUICtrlSetCursor (-1, 2), but all Cursors works except 2 - crDrag

Why and how to set that Cursor on another way?!


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
rasim

n3nE

Post the example.

Edited by rasim

Share this post


Link to post
Share on other sites
Madza91

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 250, -1, -1)
$Label1 = GUICtrlCreateLabel("Cursor should be crDrag", 8, 8, 228, 225, $WS_BORDER)
GUICtrlSetCursor (-1, 2)
$Label2 = GUICtrlCreateLabel("Cursor should be crHandPoint", 240, 8, 252, 225, $WS_BORDER)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
SmOke_N

Might want to look at MouseGetCursor() in the help file (as GUICtrlSetCursor() tells you too...), it has a list of cursor settings. And #2 is the arrow cursor (usually what you're already using before you change the cursor).

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Madza91

In Koda GUI creator when I chose crDrag, in Code I get: GUICtrlSetCursor (-1, 2)

...I tried MouseGetCursor(), and there are no crDrag cursor -.-


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
SmOke_N

In Koda GUI creator when I chose crDrag, in Code I get: GUICtrlSetCursor (-1, 2)

...I tried MouseGetCursor(), and there are no crDrag cursor -.-

And... ? That means there is no crDrag (kind of my point).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Madza91

Then it is bug in Koda ^^

...And you want to say it isn't possible to set that cursor?


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
SmOke_N

Then it is bug in Koda ^^

...And you want to say it isn't possible to set that cursor?

It's not possible with that function. crDrag has the little box under it right? It must be possible, because autoit uses something similar with their drag query on listviews, but I'm fairly sure it's a resource, no idea how they've set it internally either.

Edit:

Is crDrag even a Windows API option? Or is that some Delphi option? I can't find much on it with windows api calls (nothing in fact), so I'm assuming it's like loading a cursor from a file/resource.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Malkey

In Koda GUI creator when I chose crDrag, in Code I get: GUICtrlSetCursor (-1, 2)

...I tried MouseGetCursor(), and there are no crDrag cursor -.-

This example do not solve your problem, but you might find it interesting.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $CursorDesc[18] = ["0 = UNKNOWN ", "1 = APPSTARTING", "2 = ARROW", "3 = CROSS", "4 = HELP", _
        "5 = IBEAM", "6 = ICON", "7 = NO", "8 = SIZE", "9 = SIZEALL", "10 = SIZENESW", "11 = SIZENS", _
        "12 = SIZENWSE", "13 = SIZEWE", "14 = UPARROW", "15 = WAIT", "16 = Invisible", "? = DRAG"]
Local $Label[18], $x = 0, $y = -100
$Form1 = GUICreate("Cursor Types", 416, 516, -1, -1)
For $p = 0 To 17
    $x += 1
    If Mod($p, 4) = 0 Then
        $y += 100
        $x = 0
    EndIf
    $Label[$p] = GUICtrlCreateLabel("Cursor Number " & $CursorDesc[$p], 8 + 100 * $x, 8 + $y, 100, 100, $WS_BORDER)
    If $p = 17 Then
        GUICtrlSetCursor(-1, 4)
    Else
        GUICtrlSetCursor(-1, $p)
    EndIf
Next
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
martin

This example do not solve your problem, but you might find it interesting.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $CursorDesc[18] = ["0 = UNKNOWN ", "1 = APPSTARTING", "2 = ARROW", "3 = CROSS", "4 = HELP", _
        "5 = IBEAM", "6 = ICON", "7 = NO", "8 = SIZE", "9 = SIZEALL", "10 = SIZENESW", "11 = SIZENS", _
        "12 = SIZENWSE", "13 = SIZEWE", "14 = UPARROW", "15 = WAIT", "16 = Invisible", "? = DRAG"]
Local $Label[18], $x = 0, $y = -100
$Form1 = GUICreate("Cursor Types", 416, 516, -1, -1)
For $p = 0 To 17
    $x += 1
    If Mod($p, 4) = 0 Then
        $y += 100
        $x = 0
    EndIf
    $Label[$p] = GUICtrlCreateLabel("Cursor Number " & $CursorDesc[$p], 8 + 100 * $x, 8 + $y, 100, 100, $WS_BORDER)
    If $p = 17 Then
        GUICtrlSetCursor(-1, 4)
    Else
        GUICtrlSetCursor(-1, $p)
    EndIf
Next
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
That's a great idea Malkey.

( I got tired of waiting for the cursor to change to number 15 though :mellow: )


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
motionman95

Was there ever a solution for this?


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.