Jump to content

Set Cursor No. 2


Madza91
 Share

Recommended Posts

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) :)

Link to comment
Share on other sites

#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) :)

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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) :)

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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) :)

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • 3 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...