Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / January 2006

Tip: Looking for answers? Try searching our database.

Manual set the ID of an System.Windows.Forms.Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paul - 26 Jan 2006 12:26 GMT
I need to set the controlid of a text box manually. It seem that the id of an
control now changes everytime i start the application. I need this for an
single logon-form to make the singlesignontool http://www.passlogix.com/ work.
(The use of ControlId´s was very common used in com-windowsapplications.)

thank you
paul
Herfried K. Wagner [MVP] - 26 Jan 2006 13:28 GMT
"paul" <paul@discussions.microsoft.com> schrieb:
>I need to set the controlid of a text box manually. It seem that the id of
>an
> control now changes everytime i start the application.

Which ID are you referring to?

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>

paul - 26 Jan 2006 15:18 GMT


"Herfried K. Wagner [MVP]" schrieb:
> Which ID are you referring to?

The control ID of any Control. It is shown with Microsoft Spy++ for all
"ControlWindows".
Spy++: After "finding" the control it is shown in the General-tab in the
"Window Property".

thank you
paul
Patrice - 26 Jan 2006 15:31 GMT
Try to see if this is the Handle property. If yes, the principle would be
then to pass this value whatever it is to this low level API...

Good luck.

Signature

Patrice

> "Herfried K. Wagner [MVP]" schrieb:
> > Which ID are you referring to?
[quoted text clipped - 6 lines]
> thank you
> paul
paul - 26 Jan 2006 16:01 GMT
>Try to see if this is the Handle property
yes, it ist the handle. How can i manually set the handle in a save mode?
Patrice - 26 Jan 2006 16:16 GMT
This is AFAIK exactly as a file handle that is just some kind of unique
value that is initialized by the OS...
IMO you could just read the value whatever it is and pass this value to the
API you are trying to use...

(I find a bit strange a Single Sign On API needs to go at such a low level,
are you sure they don't mean that you should pass some kind of value that
uniquely identifies the user ?)

Signature

Patrice

> >Try to see if this is the Handle property
> yes, it ist the handle. How can i manually set the handle in a save mode?
paul - 26 Jan 2006 16:28 GMT
> This is AFAIK exactly as a file handle that is just some kind of unique
> value that is initialized by the OS...

this would be a problem - in special case the same logonwindow would be
shown twice.
So i have to change only the control Id (how?) or find an complete
alternative solution.

> (I find a bit strange a Single Sign On API needs to go at such a low level,
> are you sure they don't mean that you should pass some kind of value that
> uniquely identifies the user ?)
The write the username and the password directly in the LogonWindow. (not
only in our app)

regard paul
Patrice - 26 Jan 2006 16:44 GMT
Someone else would perhaps popup but IMO your best bet is likely to try a
group focussed on C/C++/Windows API and explain there the details. AFAIK
this is just defined by the OS and you can't define this yourself (this is
AFAIK basically a pointer into OS maintained structures).

The last resort I see if the problem is that the value change would be to
keep this windows around for the whole application lifetime. You can't
define the value but this way it will be always the same for a given
session.

Also you could just perhaps call again the API when the window is created
again so that this API is aware of this change...

Good luck...

Signature

Patrice

> > This is AFAIK exactly as a file handle that is just some kind of unique
> > value that is initialized by the OS...
[quoted text clipped - 11 lines]
>
> regard paul
Herfried K. Wagner [MVP] - 26 Jan 2006 23:25 GMT
"Patrice" <a@bc.c> schrieb:
> Someone else would perhaps popup but IMO your best bet is likely to try a
> group focussed on C/C++/Windows API and explain there the details. AFAIK
> this is just defined by the OS and you can't define this yourself

ACK.  Handles are chosen by the operating system.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>

Mattias Sjögren - 26 Jan 2006 21:20 GMT
>I need to set the controlid of a text box manually. It seem that the id of an
>control now changes everytime i start the application. I need this for an
>single logon-form to make the singlesignontool http://www.passlogix.com/ work.
>(The use of ControlId´s was very common used in com-windowsapplications.)

Control ID isn't the same as the handle (HWND). I'd expect the sign on
tool to use the control ID since it's usually constant whereas handles
can differ every time you create a control.

You can't directly influence which control ID a control gets in
Windows Forms. But IIRC it should be the same every time as long as
you don't modify the form. I belive it's derived from the order the
controls are added to the form or possibly the z-order.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.