[AccessD] Cursor Color

Heenan, Lambert Lambert.Heenan at AIG.com
Wed Feb 23 11:11:17 CST 2005


Hmm. Well all I know (little enough!) is that when I played around with the
APIs the morning that the caret stayed the same in every running
application. However, I have to admit that I did not use the GetFocus API -
so perhaps that was the missing piece of the puzzle.

Lambert

> -----Original Message-----
> From:	accessd-bounces at databaseadvisors.com
> [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
> Sent:	Wednesday, February 23, 2005 11:34 AM
> To:	accessd at databaseadvisors.com
> Subject:	RE: [AccessD] Cursor Color
> 
> Lambert,
> 
> 2 parts:
> 
> 1st:  In this scenario...it wouldn't matter anyway.  This will be the only
> 
> app that ever runs on these machines.
> 
> 2nd:  When I set ip up this way...anytime this box looses focus(without me
> 
> setting it back) the cursor reappears...and while it has focus...I've 
> launched other apps...and none seem to be affected( as far as I can tell).
> 
> Is there a scenario that I could recreate to test what you described?
> 
> Thanks,
> 
> Mark
> 
> >From: "Heenan, Lambert" <Lambert.Heenan at aig.com>
> >Reply-To: Access Developers discussion and problem 
> >solving<accessd at databaseadvisors.com>
> >To: "'Access Developers discussion and problem 
> >solving'"<accessd at databaseadvisors.com>
> >Subject: RE: [AccessD] Cursor Color
> >Date: Wed, 23 Feb 2005 10:56:45 -0500
> >
> >Your users will hate you. Changing the caret is a system wide thing I
> >believe and all applications will show (or not) the caret. If your
> >application crashes (or you forget to restore the blink rate in some 
> >obscure
> >corner of your code) then the users will be stuck with whatever your code
> >has set. They will have to reboot to get back to "normal".
> >
> >Lambert
> >
> >
> > > -----Original Message-----
> > > From:	accessd-bounces at databaseadvisors.com
> > > [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of Bobby Heid
> > > Sent:	Wednesday, February 23, 2005 10:17 AM
> > > To:	'Access Developers discussion and problem solving'
> > > Subject:	RE: [AccessD] Cursor Color
> > >
> > > Mark,
> > >
> > > >From the little research I just did, it looks like you could use the
> > > ShowCaret/HideCaret and GotFocus APIs.  You have to use the GotFocus
> API
> > > call to return the handle of the object that has the focus.  This is
> > > because
> > > many of the controls in Access do not have a
> > > hWnd property.
> > >
> > > >From what I have found, you first set the focus (may work if you do 
> >this
> > > after the gotfocus event) to the text box.  The you call the GotFocus 
> >API
> > > call to return the handle.
> > >
> > > So maybe something like this (assuming we are in the gotfocus event):
> > >
> > > 'API definitions
> > > Public Declare Function GetFocus Lib "user" () As Long
> > > Private Declare Function HideCaret Lib "user32" (ByVal hwnd As Long)
> As
> > > Long
> > > Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long)
> As
> > > Long
> > >
> > > dim hWnd as long
> > >
> > > hWnd=GotFocus()	'get the handle of the text box (really whatever has
> > > the
> > > focus)
> > > HideCaret hWnd
> > >
> > >
> > > If you wanted to set the focus yourself, use textbox.setfocus before
> > > calling
> > > the above GotFocus API function.
> > >
> > > I think in your example you would want to turn off the cursor in the
> > > gotfocus event and turn it back on in the lostfocus event.  I think
> that
> > > windows wants to keep turning it back on (such as if you click in the 
> >text
> > > box again after gotfocus, so you may have to turn it off based upon
> > > several
> > > events.  You will just have to play with it.
> > >
> > > Bobby
> > >
> > > -----Original Message-----
> > > From: accessd-bounces at databaseadvisors.com
> > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A
> Matte
> > > Sent: Wednesday, February 23, 2005 9:11 AM
> > > To: accessd at databaseadvisors.com
> > > Subject: RE: [AccessD] Cursor Color
> > >
> > >
> > > Hello All,
> > >
> > > Any ideas on this one?
> > >
> > > >
> > > >When a text box gets focus...the cursor blinks a different
> > > >color...regardless of the background or forecolor settings...is there
> > > away
> > > >to make the cursor the same color as the background...or invisible?
> > > >
> > > >Thanks,
> > > >
> > > >Mark
> > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> >--
> >AccessD mailing list
> >AccessD at databaseadvisors.com
> >http://databaseadvisors.com/mailman/listinfo/accessd
> >Website: http://www.databaseadvisors.com
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list