Solved

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

Posted on 2004-08-08
7
330 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

758 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

20 Experts available now in Live!

Get 1:1 Help Now