|
Actually, I figured I would Post this here. This function will Lock as many Windows as you want from Redrawing...unlike the "LockWindowUpdate" Function.
'API Declarations (.NET)
Private Declare Ansi Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
'Routine to Lock a Window from Repainting
Public Sub LockWindowUpdate(ByVal Handle As IntPtr, ByVal Lock As Boolean)
Const WM_SETREDRAW As Integer = &HB
'Enable / Disable Drawing
Call SendMessage(Handle, WM_SETREDRAW, Math.Abs(CInt(Lock)), 0)
End Sub
'API Declarations (VB6)
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
'Routine to Lock a Window from Repainting
Public Sub LockWindowUpdate(ByVal Handle As Long, ByVal Lock As Boolean)
Const WM_SETREDRAW As Long = &HB
'Enable / Disable Drawing
Call SendMessage(Handle, WM_SETREDRAW, Abs(CInt(Lock)), 0)
End Sub
|
|
|
|
|
I have a legacy app in SETUP form only which appears to be created with VB version 5. Are there any command line parameters for this setup?
Thanks
Davy
Weblog, Ramblings and more...
www.latedecember.com
|
|
|
|
|
Davy Mitchell wrote:
Are there any command line parameters for this setup?
More info....
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
|
May I know how to launch an external exe file from my application. Just like launching an external Word Document from application.
Besides that, any code that can be used to prevent an application that being launched more than one time.
please help. thanx in advance.
|
|
|
|
|
Desmond wrote:
May I know how to launch an external exe file from my application.
Use the Shell command. There are ways to check to see if an instance of a Word or Excel object is already in existence such as GetObject . Hope this helps.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Hi,
You may use Process.Start (from System.Diagnostics.Process). That provides granular control over the process you are starting.
Perhaps the following URL should open MSDN Documentation too:
ms-help://MS.NETFrameworkSDK/cpref/html/frlrfsystemdiagnosticsprocessclassstarttopic.htm
process.Start("http://www.codeproject.com") where process is an object of Process opens the default browser and navigates to codeproject.com
While shell might still execute system commands, you might not be able to control execution of those programs to the level that Process allows you to do so.
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Hello
I've got a problem with VB.NET/Windows Application. I have a DataSet, and I want to connect columns from different DataTables to one view in the DataGrid. Is this possible?
/e
|
|
|
|
|
Greetings
As far as I know that is not possible. One way around is to create a temporary datatable with desired columns and copy the data there. This, however, does consume some amount of memory. It should not be an issue if the data is not very big.
Nothing else comes to my mind right now.
|
|
|
|
|
I'm trying to draw a single black border around my dialog using the following code:
Private Sub LogInDialog_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim Rect As New Rectangle(e.ClipRectangle.X, e.ClipRectangle.Y, e.ClipRectangle.Width - 1, e.ClipRectangle.Height - 1)
e.Graphics.DrawRectangle(Pens.Black, Rect)
End Sub
I have a ComboBox control on the page along with some text fields and such. When I drop the ComboBox's List control, then contract it again, there are marks from where the listbox was (I can see it behind the other controls on the page below the ComboBox). I tried bringing the control to the front, but that didn't help. Any ideas?
Thanks in advance for any help.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Jamie Nordmeyer wrote:
Any ideas?
Yep, but I know there is a better solution, however this will work for you as I just tried it.
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Me.Refresh()
End Sub
Let me know, hope it helps.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Hey there, Nick. Thanks for the reply. Actually, I figured it out at the end of the day yesterday, then promptly kicked myself. I was using the clipping rectange (e.ClipRectangle), which only specifies the area that needs updating, not the whole dialog (been doing ASP.NET stuff for the last year, so I forgot a few of my 'Windows programming rules'). Anyway, I changed all the e.ClipRectangle parts to DisplayRectangle (e.ClipRectangle.X to Me.DisplayRectangle.X), and it works great.
Again, thanks for thought.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Hello Jamie:
I am trying to do the similar thing. i need to draw a rectangle and fill with white color. Any idea? Thanks
Zulfikar Ali
|
|
|
|
|
From with a paint event handler, you can use
e.Graphics.FillRectangle(Color.White, Rect)
replacing Rect with the rectangle you want to fill. Did that answer your question?
Jamie.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Hi,
First, it is the first time I'm doing something in VB.
I have a problem :
I want to make a vb script to create a registry key in our buildAll.bat file, which is builing all our VC++ dlls/exes.
Here is my script :
<br />
Dim MyPath <br />
MyPath = CurDir<br />
Dim intDoIt<br />
intDoIt = MsgBox(MyPath)<br />
Set WshShell = WScript.CreateObject("WScript.Shell")<br />
WshShell.RegWrite "HKLM\SOFTWARE\Company\Product\InstallDir", MyPath<br />
As you can see, I'm trying to set the install path from the current path.
The problem is that the script doesn't works : the MyPath variable is empty.
Any idea ?
thanks in advance.
Stephane
www.exotk.org
|
|
|
|
|
forget it !
I created a win32 exe doing it.
Stephane
www.exotk.org
|
|
|
|
|
If you have the latest scripting engine (5.6), you can use the CurrentDirectory property of the Shell object:
Dim WshShell : Set WshShell = WScript.CreateObject("WScript.Shell")
Dim MyPath : MyPath = WshShell.CurrentDirectory
Dim intDoIt : intDoIt = MsgBox(MyPath)
WshShell.RegWrite "HKLM\SOFTWARE\Company\Product\InstallDir", MyPath
|
|
|
|
|
What is about MyPath = WScript.Path?
Or using WScript.ScriptFullName and WScript.ScriptName?
With best wishes,
Vita
|
|
|
|
|
Which attribute should I set?
Thanks
|
|
|
|
|
The following will ensure the form is kept on top:
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const SWP_SHOWWINDOW = &H40
Const SWP_DRAWFRAME = &H20
Private Sub Form_Load()
Dim retval As Long
retval = SetWindowPos(Me.hwnd, HWND_TOPMOST, 100, 100, 100, 100, SWP_DRAWFRAME Or SWP_SHOWWINDOW)
End Sub
|
|
|
|
|
In VB.NET, set the TopMost property to True.
In VB6, search MSDN for Q184297
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Hi Folks
I have got something for you to think about...the thing is i have a text file which contains huge dataset( delimited records). It has a trailer at the end which will have the record count and other relevant information about the text file.
Now i need to verify whether the record count mentioned in the trailer is correct.
i am right now doing this by looping through entire file and incrementing the count.
The issue is since this is a line by line read operation its taking hell alot of time.
These are the questions
Is there a way through which we can find how many lines in a file.
Is there a way to read the entire file as a stream in VB6.0.
Please help me asap
Best Regards
Venkatraman Kalyanam
Chennai - India
"Being Excellent is not a skill, it is an attitude"
|
|
|
|
|
You can use the FileSystemObject to do this.First of all, add a reference to "Microsoft Scripting Runtime". The add the followinf code (more or less) :
**********************************************************************
Dim FSys as New FileSystemObject
Dim txtStr as TextStream, iLine as Integer
Set txtStr = FSys.OpenTextFile (FileName)
Do While Not (txtStr.AtEndOfStream)
txtStr.SkipLine
Loop
iLine = txtStr.Line
**********************************************************************
This should be faster than reading the whole text file line by line
|
|
|
|
|
I need to make a VB 6.0 program to comunicate with MCS51 via ibm interfacing printer ports, any body got the code with explanation of how it works?
Thank for your help
|
|
|
|
|
I've created an addin in VB.Net using the Extensibility Projects/Shared Add-ins project wizard to start. Anyway I've finished everything and got the beast working just fine on my system, however I can seemd to get it to install and run on another system. I checked the registry keys and it appears that everything is there... I've been working on this for a few weeks and haven't seemed to make any progress and am running out of ideas. There must be something that I'm overlooking!
I tried using the VB setup and deployment project, as well as using Installshield Developer 7.04 to create installation projects. They all run fine, and like I said before, they ARE creating the registry keys.
Any ideas or suggestions,
Thanks!
-Steve
|
|
|
|