Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Well, it's back to the trial and error method again - which usually works. A friend helped me create a webview2 viewer window. What a neat way to attach to the web site via a C# program. It sure beats using c#'s linklabel. But I have run into a problem or two using webview2. When the webview2 is called up, it sure works great!. So all my c# linklabel code quietly disappeared fast. SO the problem: so when you're finished using your webview2 webpage(s) viewer, you would normally just exit/close out of the form. But with just exiting out, you actually leave the webview2 viewer running and it sits on top of your calling form, and with nothing else you can do, you have to abend it.

So now, how can you destroy the webview2 viewer while exiting out of the form gently, and return back to the calling form with no side effects from the webview2 viewer that's being destroyed( like nothing had ever happened).

I suspect that I have to use these functions:
1) BuildWindowCore(HandleRef)
2) DestroyWindowCore(HandleRef)

Am I wrong or what.
Are there some real/excellent c# sharp examples that would show me how?

Any help would sure be helpful. Please
RSVP.

Member 15028314

What I have tried:

So what have I done and tried? I have an working C# example of the program using webview2 viewer available upon request via email that I can show you. And it works, along with those bugs that I having problems with.
Posted
Updated 29-Mar-21 20:32pm

1 solution

See Michael T. Russin's WebView2 examples here: [^]

See this thread: [^]

Post selected code in your question that is relevant to your problem.

"But I have run into a problem or two using webview2. When the webview2 is called up, it sure works great!. So all my c# linklabel code quietly disappeared fast."

Explain this in your question in detail,
 
Share this answer
 
Comments
Member 15028314 30-Mar-21 22:36pm    
Ok BillWoodruff, what is going on! I did explain everything that had happened in the question in detail. I stated that I would email the code that I am using via a valid email address. I'm not willing to divulge what I've done to the watching/viewing public. I'm willing to do my part, but not go and do a massive program search thru massive amounts of C# code while you make me do everything. On one question, I worked with
OriginalGriff on a question and I did what I could on my part. I had the program with errors that I was willing and offering to send via a valid email address(showing my effort/part). And with OriginalGriff's help and with what I had to do, things worked out quite well. I despise working someone whom thinks I have not done the/any work nor explained the situation at hand. It's like you're playing GOD, and making me
do all the work. You need to review the question that I asked; again! And in there(the question), I have explained the situation that I'm facing. The phrase that you do not understand is that when my webview2 program came up, the end results(the webview2 window) was/looked awesome and neat. So I deleted all my other C# linklabel code soon thereafter, cause the C# linklabel code was not working the way that I wanted it to do. I did
explain the situation at hand. I explained the visual end results, and the final visual end results of attempting to close the webview2 window -- which is the situation that I'm trying fix. So, if I may say it gently, getdown off your perch of authority and overbearance, and help in an understanding and kind way - from someone whose
from the old college who wants to learn. Okay? Please? If you are a true moderator, you do have access to email address' and names thereof. So, please, I'd appreciate some help. Thanks, RSVP Please...

Member 15028314

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900