Announcement

Collapse
No announcement yet.

2 Questions... Animated Cursors and Color Dialog

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ian Cairns
    replied
    there is also a choosecolor demo here:

    http://www.powerbasic.com/support/pb...ad.php?t=22571

    regards,

    ------------------
    [email protected]

    Leave a comment:


  • Eric Pearson
    replied
    to answer question #2 i just posted this in the source code forum...

    http://www.powerbasic.com/support/pb...ad.php?t=22592

    ------------------
    perfect sync: perfect sync development tools
    email: mailto:[email protected][email protected]</a>



    [this message has been edited by eric pearson (edited march 01, 2000).]

    Leave a comment:


  • Semen Matusovski
    replied
    SetCursor LoadCursorFromFile ("filename.ANI") works fine for me

    Short sample:
    Code:
    #Compile Exe
    #Register None
    #Include "Win32Api.Inc"
    
    Function PbMain()
       Local hDlg As Long
       Dialog New 0 ,"SubClass ?", 0, 0, 200, 100, %DS_CENTER Or %WS_SYSMENU To hDlg
       Control Add Label,  hDlg, 101, "Label", 10, 5, 30, 12
       Control Add TextBox,  hDlg, 201, "Edit control-1", 10, 25, 170, 12
       Control Add Button,  hDlg, 102, "&Button", 40, 5, 130, 12
       SetClassLong hDlg, %GCL_HCURSOR, LoadCursorFromFile ("C:\Winnt\Cursors\Globe.ANI")
       SetClassLong GetDlgItem(hDlg, 102), %GCL_HCURSOR, LoadCursorFromFile ("C:\Winnt\Cursors\HAND.ANI")
       SetClassLong GetDlgItem(hDlg, 201), %GCL_HCURSOR, LoadCursorFromFile ("C:\Winnt\Cursors\HORSE.ANI")
       Dialog Show Modal hDlg
    End Function
    [This message has been edited by Semen Matusovski (edited March 01, 2000).]

    Leave a comment:


  • Eric Pearson
    replied
    I forgot to mention that many animated "cursors" are actually animated icons. So you may have to use %IMAGE_ICON with LoadImage, not %IMAGE_CURSOR.

    -- Eric

    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>

    Leave a comment:


  • Eric Pearson
    replied
    LoadImage should work fine. Without the LR_LOADFROMFILE equate, of course. The first parameter would be the instance handle of your EXE (from the hCurInstance parameter of the WinMain function) and the second parameter would be the identifier number of an animated icon that is embedded in the $RESOURCE file. It is also possible (but less efficient) to use a string identifier for an icon.

    I'm not sure how you would include an ANI file in a resource file, however. Visual Studio did not allow me to do it just now. Maybe you have to rename it to *.ICO and embed it as a normal icon?

    -- Eric



    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>

    Leave a comment:


  • RyanCross
    started a topic 2 Questions... Animated Cursors and Color Dialog

    2 Questions... Animated Cursors and Color Dialog

    QUESTION 1:

    How do I load an animated cursor from your resource. I tried using LoadCursor and LoadImage, but they didn't work. I'm using LoadImage right now to laod it from a file, but I want the cursor in the EXE. How do I do this or what am I doing wrong?

    QUESTION 2:

    Can someone please post a Common Dialog Choose Color example. I searched the forums but couldn't find one. I tried doing it myself but I keep getting errors.


    -------------
    Thank you,
    Ryan M. Cross
    Head Webmaster Nofee Inc. Internet Services
    President Likuid Creations Ltd.

Working...
X