Minulla on työn alla sovellus joka käynnistyessään lataa tietoa levyltä ennen sovellusikkunan avautumista. Tiedon määrä ja siten odotusaika vaihtelevat. Tarkoituksena olisi jotenkin osoittaa käyttäjälle että ohjelma tekee jotain ennen ikkunan avaamista ja osoittimen muuttaminen tiimalasiksi voisi olla siihen hyvä. Ongelmana on että osoittimen muuttaminen normaalikeinoilla ei tunnu oikein toimivan ennen kuin pääikkuna on auki (WM_SETPOINTER-viestiä ei kai käsitellä).
Joten, miten saisi näppärästi vaihdettua systeemikursorin tuollaiseksi tiimalasiksi siksi aikaa kun ohjelma tekee alustuksia. Nykyisellään ohjelmassa on alussa splash screen, joka tosin on näkyvissä vain vähän aikaa ajastimen kanssa (ajastinta voisi kasvattaa tai muuttaa sulkemisen manuaaliseksi) mutta tuo tiimalasikursori olisi hyvä.
Käytössä Visual C 6.0
Joten, miten saisi näppärästi vaihdettua systeemikursorin tuollaiseksi tiimalasiksi siksi aikaa kun ohjelma tekee alustuksia. Nykyisellään ohjelmassa on alussa splash screen, joka tosin on näkyvissä vain vähän aikaa ajastimen kanssa (ajastinta voisi kasvattaa tai muuttaa sulkemisen manuaaliseksi) mutta tuo tiimalasikursori olisi hyvä.
Käytössä Visual C 6.0
Vastaukset 3
Vanhimmat
Mikset voisi luoda sitä ikkunaa normaalisti, mutta asettaa sitä ShowWindow-funktiolla piiloon? Sitten muutat kursorin ja lataat tiedot. Sitten lopuksi pistät ikkunan taas näkyviin samaisella komennolla.
splashin screenin käyttö ?
Threadit, missä voi vatkaa noita tiimalaseja,
gauge bar mikä näyttää lataamisen keston.
Timer --- mitä en suosittele missään nimessä, mutta silläkin sen saa tehtyä.
Onhan noita :)
SUORAAN MSDN
LoadCursor Function
--------------------------------------------------------------------------------
The LoadCursor function loads the specified cursor resource from the executable (.EXE) file associated with an application instance.
Note This function has been superseded by the LoadImage function.
Syntax
HCURSOR LoadCursor( HINSTANCE hInstance,
LPCTSTR lpCursorName
);
Parameters
hInstance
[in] Handle to an instance of the module whose executable file contains the cursor to be loaded.
lpCursorName
[in] Pointer to a null-terminated string that contains the name of the cursor resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can also be used to create this value. To use one of the predefined cursors, the application must set the hInstance parameter to NULL and the lpCursorName parameter to one the following values:
IDC_APPSTARTING
Standard arrow and small hourglass
IDC_ARROW
Standard arrow
IDC_CROSS
Crosshair
IDC_HAND
Windows 98/Me, Windows 2000/XP: Hand
IDC_HELP
Arrow and question mark
IDC_IBEAM
I-beam
IDC_ICON
Obsolete for applications marked version 4.0 or later.
IDC_NO
Slashed circle
IDC_SIZE
Obsolete for applications marked version 4.0 or later. Use IDC_SIZEALL.
IDC_SIZEALL
Four-pointed arrow pointing north, south, east, and west
IDC_SIZENESW
Double-pointed arrow pointing northeast and southwest
IDC_SIZENS
Double-pointed arrow pointing north and south
IDC_SIZENWSE
Double-pointed arrow pointing northwest and southeast
IDC_SIZEWE
Double-pointed arrow pointing west and east
IDC_UPARROW
Vertical arrow
IDC_WAIT
Hourglass
Return Value
If the function succeeds, the return value is the handle to the newly loaded cursor.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Remarks
The LoadCursor function loads the cursor resource only if it has not been loaded; otherwise, it retrieves the handle to the existing resource. This function returns a valid cursor handle only if the lpCursorName parameter is a pointer to a cursor resource. If lpCursorName is a pointer to any type of resource other than a cursor (such as an icon), the return value is not NULL, even though it is not a valid cursor handle.
The LoadCursor function searches the cursor resource most appropriate for the cursor for the current display device. The cursor resource can be a color or monochrome bitmap.
Windows 95/98/Me: LoadCursorW is supported by the Microsoft® Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
Example
For an example, see Creating a Cursor.
Function Information
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
Minimum operating systems Windows 95, Windows NT 3.1
Unicode Implemented as Unicode and ANSI versions on Windows NT, Windows 2000, Windows XP
See Also
Cursors Overview, LoadImage, MAKEINTRESOURCE, SetCursor, SetCursorPos, ShowCursor
--------------------------------------------------------------------------------
© 2003 Microsoft Corporation. All rights reserved