Solved

Need to create a 'static' picture box control visible to other apps

Posted on 2004-08-08
7
331 Views
Last Modified: 2008-02-01
I am using an app that will show video in a picture box on a form in my vb6 application.
All the app requires is that I name the picturebox something specific and that the picturebox control is 'static'.
1. Can you please tell me exactly what 'static' means in this context?
2. Is it possible to make the control static in vb6?  I have used SysTree++ to look at the example exe which was included and SysTree++ shows a [Static] description next to the control in the demo .exe, but the demo was created in c++.

This is driving me bonkers, I am just chasing my tail at the moment and am not sure if this is even possible.
Thanks
0
Comment
Question by:mikesteribar
  • 4
  • 2
7 Comments
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11746207
If you just give it that specific name it doesn't work?

Darko
0
 

Author Comment

by:mikesteribar
ID: 11746216
No,

In the process viewer I see

Window: 0007032C "Form1" ThunderRT6FormDC
Window: 0007032E "" ThunderRT6PictureBoxDC

(also a couple of other lines, but these seem to be the relevant ones)
It seems that the form is visible, but I guess that the empty string in the second line is the problem for the picturebox?
0
 
LVL 22

Accepted Solution

by:
DarkoLord earned 125 total points
ID: 11746234
Okay, set the caption using this code:

Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

Private Sub Form_Load()
    SetWindowText Picture1.hwnd, "test"
End Sub

Darko
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:Shauli
ID: 11746243
Maube you need to create the picturebox on the fly and declare it as 'Static", as in:

Static myPicture As Control
Set myPicture = Me.Controls.Add("VB.Picturebox", "myPicture", Form1)

myPicture.Left = 120
myPicture.Top = 120
myPicture.Width = Me.Width - 360
myPicture.Height = Me.Height - 600
myPicture.Visible = True

S
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11746250
If you declare it as Static it doesn't make any difference... I think he just needs to change the caption my code above and it should work..

Darko
0
 

Author Comment

by:mikesteribar
ID: 11746282
Thanks DarkoLord,
Works perfectly :)
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11746293
You're welcome!

Darko
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now